home *** CD-ROM | disk | FTP | other *** search
/ Aminet 44 / Aminet 44 (2001)(GTI - Schatztruhe)[!][Aug 2001].iso / Aminet / game / 2play / ChaosHeavy.lha / Chaos / History1997-1999.txt < prev    next >
Text File  |  2001-02-21  |  471KB  |  10,271 lines

  1. Massive Changes made by James Conwell.
  2.  
  3. Begin Version 1.6  Jan. 6th 1997
  4. *Enhanced Pronuciation of Speech.
  5. *Made numerous enhancements to program documentation.
  6. *Made numerous enhancements to the User Manual.
  7.  
  8. My dad told me that he was playing a game of Chaos 1.5 and he had a magic
  9. bow with Range Boost.  Everything was great.  He then got _another_ magic
  10. bow so he thought "Oh cool!  Now I can be even more powerful!"  He cast
  11. magic bow and it removed his Range Boost!  He was not happy.
  12.  
  13. One thing that has always annoyed me is not knowing if I have line of sight
  14. diagonally adjacent to a generator or wall.  I hate it when I try to cast a
  15. creature into a blank spot by a generator and then it says I can't because
  16. I don't have line of sight!  Sometimes it works, sometimes it doesn't.  It
  17. all depends on the quadrant.
  18.  
  19. I have decided to alleviate this and add a new capability at the same time.
  20. Spells now have a CAST_LOS bit.
  21.  
  22. Here is a complete list of things that I have changed in the cast.tex so
  23. far:
  24.  
  25. *1. Added a new bit to CastInfo[]  called CAST_LOS.  This bit determines if
  26.     a spell needs Line Of Sight or not.  This solves the problem of casting
  27.     creatures diagonally next to a generator or other large square object.
  28.  
  29.     It also allows the creation of spells that, for instance, have a range
  30.     3 but DON'T require line of sight.  Cool!
  31.  
  32. *2. I have modified the spell bits appropriately.  Now all spells have thier
  33.     CAST_LOS bit set except for spells with range of 0,1 or 15.  So everything
  34.     is functionally the same as it was.
  35.  
  36. *3. CastInfo[] is now an array of UWORDS instead of UBYTES.
  37.  
  38. *4. Made 1 change to DoCast and 2 changes to DoComputerCast to make the
  39.     new CAST_LOS bit take effect.
  40.  
  41. *5. Vengeance and Exorcise used to do the {\it exact} same thing.
  42.     So I was going to change Exorcise to only be able to be cast on Undeads
  43.     and bump the strength up to 7 to make up for this but there is no
  44.     CAST_UNDEAD or CAST_UNDEAD_ONLY bit so I just raised the strength of
  45.     Exorcise to 4.
  46.  
  47.     I just don't see the point in having 2 spells which do the exact same
  48.     thing.
  49.  
  50.     Dark Power and Justice used to do the exact same thing.  Now I have
  51.     changed Justice to be 2 sets of 3-point attacks instead of 3 sets of
  52.     2-point attacks to add some variety.
  53.  
  54.     Thus Justice is now a bit less useful but Exorcise is a bit more useful
  55.     so hopefully the play-balance is roughly the same as it was.
  56.  
  57. *6. Magic Bow is now cumulative.  Since magic bows are so rare (I've never
  58.     had 2 of them in Chaos 1.5), I have set it to bump up the range by 1 on
  59.     additional bows.  That should be a pleasant surprise to anyone if they
  60.     ever have 2 of them!
  61.  
  62. *7. Destroy Wall now destroys PowerWalls also.
  63.  
  64. *8. Made some adjustments to the TeX stuff.
  65.  
  66. *9. Show numbers beside bar graphs.
  67.  
  68. More Chaos User Manual Changes:
  69. *I made lots of little corrections.
  70.  
  71. Then I did some embellishments:
  72.  
  73. *1. I completely rewrote the intro.  Hope you don't mind.
  74.     Sorry it took so long but I just kept rereading it and editing it and
  75.     rereading it and editing it... at least 30 times...
  76.  
  77. *2. I embellished the description of the Roper, the combat section and the
  78.     impurities.
  79.  
  80. Subject: Freaky bug detected!
  81.  
  82. I read over prog.tex thinking I was just going to word correct and spell
  83. correct the tex docs.  This I did. They are now much better.
  84.  
  85.  Then I noticed something...
  86.  
  87. #define GAMEROWNTSC        14  /* number of rows in a NTSC game      */
  88. #define GAMEROWPAL         11  /* the number of rows in a PAL game   */
  89.  
  90. These 2 numbers are switched around!
  91.  
  92. PAL is higher resolution than NTSC, thus it has more rows.
  93. PAL lores = 320x256.   NTSC lores = 320x200.
  94.  
  95. I couldn't believe that the game could even work with these 2 numbers switched
  96. around so I did some more research and found out why it was working...
  97. Another bug!
  98.  
  99. Look at this from cmove.tex
  100.  
  101. int weights[GAMEROWNTSC * GAMECOL];
  102.  
  103. See, it is using what is supposed to be the small value which would be too
  104. small for PAL users which would mean you would be using out-of-bounds
  105. subscripts in PAL mode BUT since you are the luckiest programmer I've ever
  106. seen, these 2 bugs cancelled each other out!  Unbelievable!  When *I* have
  107. 2 bugs in a program they produce 4 errors, not 0.
  108.  
  109. I fixed the stuff in prog.tex and cmove.tex
  110.  
  111. Also in cmove.tex:
  112. I fixed the deal where Independent Undeads never bothered to shoot.
  113. Word corrected some tex notes.
  114.  
  115.  
  116. I noticed something else that looks highly suspicious in prog.tex:
  117.  
  118. #define NTSCMode   (GfxBase->DisplayFlags & PAL)
  119.  
  120. Shouldn't this be                           NTSC ?
  121.  
  122. Yes.
  123.  
  124. I will soon be adding a bunch of new stuff to the game and I don't want to
  125. be accused of being a memory hog so I have made 2 changes in prog.tex to
  126. save about 3k of ram.  I changed
  127.  
  128. const char creature_name[][CREATURE_SIZE] = {
  129.  
  130. to
  131.  
  132. const char *creature_name[] = {
  133.  
  134. to produce a ragged array instead of a memory wasting rectangular array.
  135.  
  136. Ditto for creature_speech.
  137.  
  138. This has saved several k of ram!
  139.  
  140. This also allowed me to delete the #define CREATURE_SIZE and SPEECH_SIZE
  141. since no part of the program ever uses either one.
  142.  
  143.  
  144. move.tex
  145. On a completely seperate subject, I made a small change to move.tex to
  146. allow me to see the _actual_ movement points available.  Sometimes if you
  147. have 2 movement points, you can move diagaonally and then straight.  Other
  148. times you can move diagonally once and then your move is over.  I am hoping
  149. that I can understand the movement system better with the real movement
  150. points showing.  I already understand it better now that I know that you
  151. are given a free .5 points at the beginning of the turn.  That helps a lot,
  152. but I still don't get some things.
  153.  
  154. *Added some prototypes to eliminate warnings with SASC6.0
  155. *Show LOS required on Spell Info screen.
  156.  
  157. Regarding using bitfields vs. NOT using bitfields:
  158. Well, here is everything I know about the subject:
  159.  
  160. accessing board[i].char_stat.Life  as a field of 5 bits vs. as a byte.
  161.  
  162. I will ignore the C overhead since I don't know precisely what that is.
  163.  
  164. At some point a move instruction will be generated to get the value then
  165. an and instruction will have to done to mask the appropriate bits.  Given
  166. the notorious inefficiency of C, probably wastes an instruction fetching
  167. the mask, but who knows.
  168.  
  169. bitfield method:
  170. move.b    source, d0
  171. move.b    mask,d1
  172. and.b    d1,d0
  173. lsr.b    #x,d0
  174.  
  175. Byte method:
  176. move.b source,d0
  177.  
  178. So here we have 4 instructions to fetch the value vs. 1 instruction.  Even
  179. if C is perfectly efficient, it WILL take at least twice as many instructions
  180. to fetch a bitfield as opposed to a byte.
  181.  
  182.  
  183. As for board[i].char_stat.Life vs. board[i].Life I would guess that the
  184. shorter version is quicker but the compiler could be clever enough that it
  185. wouldn't matter.  I am assuming that both are bytes or both are bitfields.
  186.  
  187. The reason bitfields are inherently slow is that all processors that I have
  188. ever studied are all designed to handle data in bytes, and/or words and/or
  189. longwords.  Most processors have no bitfield instructions.  Most of the
  190. processors that do have bitfield instructions (such 68020 to 68060) the
  191. bitfield instructions are much slower than a simple byte instruction (about
  192. 4x slower)  It is often faster to avoid the bitfield instruction and just
  193. use a byte instruction and an and/or instruction.
  194.  
  195. If you are really worried about speed then there is one simple thing you
  196. can do in the future to speed things up.  Avoid >>  and <<.  Shifting a
  197. variable takes an extra instruction.  So shifting and storing takes twice
  198. as long as just storing.
  199.  
  200. However, it is even worse on the 68000.  On the 68000 a shift of 1 takes as
  201. long as a regular instruction but it takes another 2 cycles for each
  202. additional shift.  So when you shift by 3  (  << 3 ) you are adding around
  203. the equivalent of 2 simple instructions to the overall execution time in
  204. assembly code.  Quite possibly more in C.
  205.  
  206. The 68020 and higher processors have a "barrell shifter" which means they
  207. can shift any number of bits left or right in the same amount of time as a
  208. shift of 1.
  209.  
  210. The only time I've really noticed chaos being slow is during computer
  211. movement on my Dad's 7.15909 Mhz A500.  I noticed a lot of math being done
  212. in cmove.tex so that probably explains it.  Multiplies take about 70 cycles
  213. and divides take about 158 cycles on the 68000.  That's like 20 regular
  214. instructions.
  215.  
  216. It basically seems ok to me on my A3000 and back when I used to play it on
  217. the A4000 it flew.
  218.  
  219. Oh yes, I forgot one thing:
  220.  
  221. Every time you access a bitfield it _must_ take at least TWO extra
  222. instructions to do that.  Each instruction is 2 bytes.  So if you have lots
  223. of code that accesses bitpacked fields then much or even all or even worse
  224. than all the space saved is wasted again.
  225.  
  226. So right now every time we access char_stat.Life, there are  2 extra
  227. instructions being generated (at least).  So if we access char_stat.Life 100
  228. times in the program then that wastes 400 bytes and we only saved 3 bits
  229. per item in creature info.  So if we have 200 objects (there aren't that
  230. many yet but there will be one day) then we saved 200*3 bits = 600 bits =
  231. about 75 bytes. A net defecit of 325 bytes.
  232.  
  233. And it takes significantly more time; executing 3 instructions instead of
  234. 1.
  235.  
  236.  
  237. Chaos is currently 190284 bytes in size.
  238.  
  239. To prove that I know what I am talking about, I will now change
  240. CreatureInfo to use all BYTES and then do a complete recompile.
  241.  
  242.  <Time Passes>
  243.  
  244.  ...
  245.  
  246.  <More Time Passes>
  247.  
  248. Ok the complete recompile is done.
  249.  
  250. Chaos is now only 187452 bytes in size!  Cool, I just saved you another
  251. 2,832 bytes.  Maximum code size was reduced by about the same amount.
  252.  
  253. The game is now faster too.  Our fathers should appreciate that. 8)
  254.  
  255. This is good because I'm fixing to add in about 5k of new
  256. variables to the program.  Heehee.
  257.  
  258.  
  259. James "The Optimizer" Strikes Again!
  260.  
  261.  
  262.  
  263. SAI changes: =========================
  264. *20 new spells!!!.
  265. *CAST_UNDEAD_FLAG
  266. *Other stuff.
  267. *Fixed a bug that sometimes causes a crash. (obtain/release semaphore)
  268. *Added some prototypes to eliminate warnings with SASC6.0
  269. ======================================
  270.  
  271. More JJC Changes
  272. Begin Version 1.7  Feb 16th, 1997.
  273. *Resurrect and RessurrectID   -> MassResurrect
  274. *Cloaked creatures now block enemy's LOS but not friendly's LOS.
  275. *No need to specially program things that don't block LOS (like Pool and
  276.  Fire).  The Chaos Engine now takes care of that for you when you set the
  277.  Blocks_LOS entry in CreatureInfo appropriately.
  278. *Added new function SameTeam to predicate.tex to assist with new LOS code.
  279. *Pick your bonus spells. I'll do the GUI later.
  280. *Fixed life 0.  Creatures didn't die when they reached 0 life.  Now they do.
  281. *Fixed Load last name from savefile.
  282. *Added lots of new stats in and set them appropriately for each creature.
  283. *Movement points as float rather than integer.
  284. *Personalities (I put in the new stats in CreatureInfo but cmove.tex still
  285.  must be changed.
  286. *Modified end-of-turn healing to heal all appropriate stats.
  287. *Modified existing combat routine to take into account negative combat.
  288.  We can now make creatures whose attacks heal instead of hurt.
  289. *Modified existing combat routine to take into account affecting
  290.  different/multiple stats other than life.
  291.  Now we can make creatures that attack any stat or combination of stats.
  292.  Such as intelligence or magic resistance etc.
  293. *Added 1 new paragraph to the docs.
  294. *Put in SpecialCombatHandler Routine which replaces WaspNestHandler
  295. *Roper, Wasp Nest, Pool, Volcano, Apple Tree are now ordinary items which
  296.  have SpecialCombat.
  297. *New predicate isSomethingThere(cell)
  298. *Modified RangedCombat routine to take into account CR_LOS.  Now we can
  299.  make creatures which have distance weapons that don't require line of
  300.  sight.
  301. *Added new predicates: AttacksLiving, AttacksUndead, isUndead
  302. *Modified maiming routine to not maim on negative combat.
  303. *Fixed Predicate.tex with modified predicates to use the new char_stat.Stat
  304.  method.
  305. *Completely absorbed SpecialFlags into char_stat.Stat.
  306. *We can now have creatures that gain or lose flying ability.
  307. *UNDEADFLAG has now been translocated into char_stat.Stat with UNDEAD_STAT
  308. * A. Lich and Lich Lord and Raise Dead have been modified appropriately.
  309. * B. search/replace all UNDEADFLAG, #define UNDEADFLAG. Done.
  310.   C. Decide what to do about slime covering you over. I guess just have
  311.      oldchar_stat
  312. * C. There was a bug with Magic Sword and Magic Knife:  If the wizard
  313.      already had MAX_COMBAT and then cast Magic Sword or Magic Knife then
  314.      he did NOT gain the abiltiy to attack undeads because the sword/knife
  315.      did not get applied.  This is now fixed.  The routine is now much
  316.      shorter also.
  317. * D. Magic Sword and Magic Bow and Magic Knife now set the appropriate
  318.      bit in board[cell].char_stat.Stat 
  319. * We can now make creatures which cannot attack living creatures, only
  320.   undeads.
  321. * We can now make creatures whose specialcombat affects very specific
  322.   groups of creatures and any combination of stats.
  323.  
  324. * Info Screen graphing is now even better!
  325.  
  326. *I have Considered making Stat an int to eliminate many warnings
  327.  but I have decided that it would be much better to just change the
  328.  functions that generate the warnings into macros.  This results in a
  329.  faster game.  A small macro should be slightly smaller than a function call.
  330.  The macro saves 4 bytes by not using bsr/rts and I guess it saves about 8
  331.  more bytes because of not pushing and pulling the parameters on/from the
  332.  stack like a function does. But it should use more bytes by having in-line
  333.  code.  All in all it should save a few bytes per macro, as long as the
  334.  macros are simple 1-line commands.
  335.  
  336.  I am certain that macros are faster.
  337.  
  338. * Experiment:  Change the following functions into macros and recompile to
  339.   measure the code size difference: 
  340.   isStatic, isMount, isDragon, isGrowth, isInanimate and isMeditation.
  341.   isFlying could be converted to a macro but that would require that
  342.   WizardWings set the flying bit on the wizard rather than setting the
  343.   .Wings bit in the wizard structure.  Why not have WizardWings simply set
  344.   both bits for now?
  345.  
  346.   Chaos is currently 194476 bytes.
  347.  
  348.   Recompiling...
  349.  
  350.   Chaos is now       194028 bytes.  I saved us another 448 bytes!  And that
  351.                                     is just for now.  The more we use the 
  352.                                     macros in the future, the more we save!
  353.                                     The game is now somewhat faster.
  354.  
  355. *ShadowForm, .Shadow, ShadowFormID -> Irvine's_Invulnerability
  356. *Heal and HealID -> Restoration.
  357. *Modifified Sencode.c so we can now have spellnames with ' in them.
  358.  
  359.  
  360.  
  361. * info screen has now been revamped to show all the new stats in a graphical
  362.   manner.
  363.  
  364. *DELETE UNDEADFLAG AND isLivingAttackingUndead from the program forever!
  365. *Edited the tex in spell.tex
  366.  
  367.  
  368.  
  369.  
  370. Begin version 1.7.2:
  371. *Replaced all occurences of board[cell].??? & CLOAKEDMASK with isCloaked
  372.  macro. (except 1)
  373. *Translated all the code so the Cloaked Stat now resides in char_stat.Stat
  374.  
  375. * Replaced all ((board[i].flag & ANIM_STATE_MASK) != DEAD) with
  376.                 (!isDead(i)) macro
  377. * Translated all the code so that Dead Stat now resides in char_stat.Stat
  378.  
  379. *Sleeping Creatures now stop being animated so you can see that they are
  380.  asleep.
  381.  
  382. C SUX!  C SUX!  I just wasted the last hour trying to figure out why the
  383. hell this program wouldn't compile.  It turned out that it WASN'T doing
  384. predicate.tex even though I had saved it TWICE and reloaded it to make sure
  385. that everything was there.  It just ignored my changes and kept using an
  386. old version that was somehow missing a ).
  387.  
  388. Transfer over the other flags like cloaked, dead, asleep, static.
  389.  
  390. I was going to transfer over asleep and static but static should never
  391. change so hopefully I can ignore that.  That leaves asleep... I'm not sure
  392. if I should have asleep in both cell.flag and char_stat.Stat for now or
  393. what. 1st I will simply replace all: 
  394.    ((board[i].flag & PLAYER_MASK) >> 3 != ASLEEP) )
  395. with !(isAsleep(i)) to make things easier to read, etc.
  396.  
  397. I was really cautious with transferring over ASLEEP.  Perhaps when I know
  398. the program better I will make things more elegant and simple.
  399.  
  400. * Translating dead and cloaked into char_stat.Stat is turning out to be a
  401.   real bitch.  Probably something will be messed up somewhere.
  402.   Hmmm.. Everything seems to be working perfectly except for the fact that
  403.   Computer controlled shooters keep shooting dead bodies.  Perhaps I forgot
  404.   a ! somewhere?  Hmmm... the computer controlled shooting looks ok and so
  405.   does the macro.  Strange.  I don't know what is wrong.
  406.   Cloaking isn't working. 2 point attacks damage.  Cloak graphic not drawn
  407.   on screen.  Ok I think I fixed everything.  Dead, cloaked, asleep, static
  408.   will reside in both board[cell].flag for the animator and
  409.   board[cell].char_stat.Stat for everything else.
  410.  
  411.  
  412. Part of the reason I want to have dead and asleep in char_stat.Stat is so
  413. that we can eventually have sleeping and dead creatures that belong to
  414. someone.  That would allow us to make more wierd spells that only affect
  415. your own or your enemy's dead creatures, etc.
  416.  
  417. * I spent all day reading the SASC manual about smake and codeprobe.
  418. * Enhanced the smakefile
  419. * Used codeprobe to figure out that screwey bug with dead creatures.  Now
  420.   everything works perfectly!
  421.  
  422. Weird bug with simulacrumming a wizard.
  423. I was controlling 2 different wizards who were not in an alliance with each
  424. other. I had Double in effect.  I double simulacrummed the other wizard.
  425. I simulacrummed the original and then I simulacrummed the copy.
  426.  
  427. I hopped one of the wizards on a unicorn and it just disappeared. It wasn't
  428. there and it couldn't dismount. Ever. The unicorn was still there but not
  429. the wizard.
  430.  
  431.  
  432. The following 3 things were psychologically torturing me:
  433. *1. WriteBottom always wrote text off the bottom of the screen
  434. *2. All the -1's for accessing the Team[] array
  435.  3. All the -1's for accessing the wizards[] array
  436.  
  437. Now I will attempt to eliminate all these -1's from the program.  I sure
  438. hope this works because it is very confusing to me, trying to tell which to
  439. use, player or player-1.  1st I will attempt to convert Team[] since there
  440. are only about 19 occurrences of Team[] to convert.
  441.   Chaos is currently 197156 bytes.
  442. Well, that wasn't much fun at all.  I ended up having to add some +1's to
  443. the program due to the way loops and variables were pre setup so it
  444. cancelled out a bunch of the advantage I was trying to get.
  445.   Chaos is now       197136 
  446.  
  447. *Team[] now goes from 0 to 8.  0 is not used but is saved and loaded.
  448.  Now we just check Team[player] instead of Team[player-1]
  449.  
  450. I think I will just pass on the wizards array, though I really wish it was
  451. based on 1 to 8 to match the wizard #. Too much of a chance of me
  452. introducing a new bug that I can't fix.
  453.  
  454. *Modified the following creatures to take advantage of the new combat system
  455. *1. Cobra is now poisonous.
  456. *2. Halfling is now _very_ magic resistant.
  457. *3. Mind Flayer now really attacks intelligence.
  458.  
  459. *Creature Recovery now handles negative recovery rates (Poison), though it
  460.  won't actually kill you yet.
  461.  
  462. *Fixed description of Justice spell.
  463.  
  464. *Numeric keys show player's creatures in RED1 if they have moved and in
  465.  WHITE if they haven't moved.
  466.  
  467. My upgrade was going along just fine until I tried to move the dead bit
  468. into char_stat.stat.  Now I actually made bugs.  Hopefully they are all
  469. fixed now.
  470.  
  471. * Fixed Lich spell description.
  472. * Pool is now a regular spell.  In my opinion it is hard enough to use due
  473.   to Eagles and things that fly up at it and also because it adds the
  474.   "Repair your forces" play mechanic to the game.
  475.  
  476. BUG: LoadGame no longer works.
  477.  
  478.  
  479. Begin 1.7.3
  480. *Made 2nd info screen to show all stats such as CR_LOS, Attacks_Undead,
  481.  Favorite Food, Afraid of,  etc.
  482.  This is something that I've been wanting for a very long time!  Now I can
  483.  see EVERYTHING about a creature.
  484.  
  485. *Made 2nd SpellInfo screen with all casting attributes. This is something
  486.  that I have _REALLY_ been wanting for a long time!  I am always casting a
  487.  spell and then I find out that I can't cast it where I want to so I have
  488.  to abort it!  I have 3 times tried to cast armour on a Violet Fungi during
  489.  an important game and it wouldn't let me.
  490.  
  491. *Give the archers actual archery skill. Reduce their range to keep the same
  492.  play balance as before.
  493.  
  494. *Give the archers 1 point of Magic Resistance recovery since their
  495.  description says they have a pure heart and have high magic resistance
  496.  
  497. *Removed archery skill from inanimates and growths.
  498.  
  499. Replace GetCell(x,y) with an array.
  500. Make Getx(cell) Gety(Cell) with an array to replace all that division and stuff.
  501.  
  502. Would GetCell really be faster?  Hmmm... I suppose not.
  503. Would Getx(cell) and Gety(cell) be faster?
  504. I think so.  Since now each one uses a division instruction but accessing
  505. a 1-dimensional array requires no multiplication or division, just 1
  506. addition to add the subscript to the base. This will be MUCH faster on the
  507. A500.  Unfortunately, I have just looked around through the code and it
  508. doesn't seem that it gets used all that much.  I'll have to use an int to
  509. prevent warnings so the question is will it be worth the 1k of ram that it
  510. will use?
  511.  
  512.  
  513. *Earthquake movescreen effect.
  514. * Horziontal_Shake
  515. * Vertical_Shake
  516. * Diagonal_Shake
  517.  
  518. *Changed Move.tex so that elementals, generators, Stone Giants
  519.  and StoneGolems and EarthQuakes shake the screen when they die.
  520.  
  521. *When an EarthQuake grows, the screen shakes.
  522.  
  523. *Speeded up screen scrolling in start.tex.  At first this made it smoother
  524.  but now it is yucky.  It is rather random.
  525.  
  526. Show team on info screen. Need Sean to redo near/far hunks or something.
  527. Show corpse (if any) on info screen somewhere.
  528. *Fixed bug with identification of bonus spells on spellinfo. Another one of
  529.  those -1 things threw me off.
  530.  
  531. *Show Powerups like combat, recoverboost and speed on info screen.  I've been
  532.  wanting this feature for a long time!  I am always having 3 creatures that
  533.  look alike EXCEPT for that 1 of them has Combat.  And then I have to click
  534.  on each 1 of them and look down at the combat stat to find which one it is.
  535.  Now the little Combat symbol is up there as a powerup so it is easier to
  536.  spot.  Looks cool too.
  537.  
  538. *Eliminated Plastic looking borders on info screens.  Now looks more
  539.  slick!
  540.  
  541. * CR_LOS is now more sensibly known as Archery in the program.
  542.  
  543.  Some sort of bug with scrolling credits.  After 20 minutes or so the
  544.  machine locks up.
  545.  
  546.  
  547. * Changed it so that creatures without ranged combat no longer have a
  548.   CombatApply mask on life for ranged combat.
  549.  
  550. * Adjusted Magic Bow and Magic Wings so they would work 100% with the new
  551.   system. 
  552.  
  553.  
  554.  
  555. Begin 1.7.4
  556.  
  557. *Set ATTACKSLIVING_STAT and ATTACKSUNDEAD_STAT for lichlord and
  558.  Magic sword/knife/bow. (move.tex/cast.tex)
  559.  
  560. *"fixed" LichLord, Simulacrum, Replicate, Vortex.
  561.  
  562. * Show allies on number keys. + change the docs.
  563.  
  564. * Allegedly fixed it so a wizard in a castle or tree can attack enemies.
  565.  
  566. * Joe made me put in numeric keypad support.
  567.  
  568. * put in new stat in cast.tex called CAST_GROWTH because the computer just
  569.   cast 6 raise deads on 6 different orange jellies.
  570.  
  571. * Things like walls and pits can now be cast ON growths.
  572.  
  573.  
  574. Begin 1.7.5
  575.  
  576. * Fixed that annoying empty dead cell bug.
  577.  
  578. * Fixed Tempests so they don't distort space.
  579.  
  580. Sometimes the Bonus Spell window ONLY displays Hide spells.  Once this
  581. starts it never seems to stop; every bonus spell for the rest of the game
  582. is displayed as a Hide spell.
  583.  
  584.  
  585. * New method of showing what stats are attacked by combat.
  586.  
  587. * Optimize the highlight routine.
  588. * The highlight routine is tooo slow so I am implementing xpixel[cell] and
  589.   ypixel[cell] which will save 2 divisions and 2 multiplications and 2
  590.   additions per relevant cell.  Highlighting a screen full of creatures,
  591.   growths and allies was just tooo slow.
  592.  
  593. * Purple combat conflicted with pink recovery so I changed Combat to BROWN.
  594.  
  595. * Growth rates were incredibly high so I doubled GCEILING to slow them down
  596.   some.
  597.  
  598. * Fixed the DarkWood so they now attack and while I was at it I changed
  599.   their abilities and description a bit.
  600.  
  601. * RMB now cancels info screens properly.
  602.  
  603. * Shortened ScreenShakes. 
  604.  
  605. * Fixed Touch of God to set CombatApply Combat and Ranged Combat for Life.
  606.  
  607. * Now Info screen shows BrainBoost, MagicShield and Armour powerups.
  608.  
  609. * Team Icon now displayed on Score Screen and TeamScore screen.
  610.  
  611. * Collapsing meditations now give at least 2 spells to pick from.
  612.  
  613. Test 8 human players with 20 spells.
  614.  
  615. Vitality Icon -Speed icon Command Icon.  I vote .5 points for.  Joe votes 1
  616. point against Joe wins.
  617.  
  618. * Team scores are now displayed but they are not sorted correctly.
  619.  
  620. BUG:
  621. Start a game with 8 human players and 20 spells each.
  622. If you cast and discard then everything is ok.  If you don't cast but you
  623. do discard then everything is ok.  But if you cast and then don't discard,
  624. the next player loses a spell (only starts with 19).
  625.  
  626. * Pick your bonus spell even if it is only 1.  This way you _know_ that you
  627.   got a bonus spell and you know exactly what you got as a bonus spell.
  628.  
  629. * The old sound system hogs 2 audio channels.  As a quick fix I just
  630.   commented out the code for 1 of the channels so now it only uses/hogs 1
  631.   channel.
  632.  
  633. ----------- LONG HIATUS ----------
  634.  
  635. Begin vesion 1.8:
  636. * July 1997: Made a teensy weensy correction to the docs.
  637. * Outlined some further ideas on gameplay in English.
  638.  
  639. * fixed some serious problems in the makefile. I had added some new
  640. functions into cell.tex and then called them from prog.tex but the game
  641. wouldn't compile because it kept complaining that there were no prototypes
  642. declared for the functions (but they were declared properly in cell.tex).
  643. The trouble was the makefile was trying to recompile chaos without FIRST
  644. recompiling cell.tex.  cell.o wasn't listed as a dependency.  Now it is.
  645. Same thing with start.o.
  646.  
  647. Presumably just about EVERY file should be listed as a dependency for
  648. Chaos.  And probably MANY files should be dependencies of many other
  649. files...  There must be a JILLION other bugs just waiting to happen in the
  650. makefile.
  651.  
  652.  
  653.  
  654. Ok, now cell gets redone EVERY time I do anything.  I just made one little
  655. change to start.tex and now cell.tex AND start.tex and spell.tex and
  656. cast.tex and info.tex, cmove.tex, move.tex, score.tex, warp.tex are ALL
  657. being recompiled!! 8(
  658.  
  659.  
  660. Ok, I just waited half an hour for my program to compile before I noticed
  661. that tex2c was caught in an infinite loop and was making an infinitely
  662. large sized cell.c file.  (There was no \end{verbatim} at the very end of
  663. cell.tex
  664.  
  665. * Added the following color effects to cell.tex:
  666. * The FadeTo___Scale routines fade the foreground only. The background stays
  667. * black.
  668.  
  669. * FadeToGreyScale (Fade the whole screen to a b&w photograph)
  670. * FadeToRedScale
  671. * FadeToGreenScale
  672. * FadeToBlueScale
  673. * FadeToCyanScale
  674. * FadeToYellowScale
  675. * FadeToMagentaScale
  676. * FadeToColor (Fade the whole screen, including the background, to a SOLID color)
  677. * LowLevelFade (fades to any colorscale)
  678.  
  679. * Added new global variable vp to be the pointer to the viewport of the game.
  680.   I needed this for my asm animator routine.
  681.  
  682. * Replaced all occurences of &(screen->ViewPort) with vp thus saving a few
  683.   bytes and cycles.
  684.  
  685.  
  686. Problem: You click on a creature and then you think about where to move
  687. him.  Where is he most needed?  Which direction should he move?  Should he
  688. attack the weak creature or the strong one?  Who's creature is that over
  689. there anyway?  .... So you highlight the ? mark and you look around at all
  690. the different creatures and one thing leads to another and pretty soon...
  691. You've forgotten which creature you were moving!   I've noticed this
  692. happening on a regular basis with people who are playing a big complicated
  693. game.   Sometimes the phone ringing can cause this same problem.
  694.  
  695. Solution:
  696. * Added animated sprite to highlight the creature whose turn it is.
  697.   Utilizes 50 fps animation so it really catches your eye. I drew a simple
  698.   little 4-frame animated sprited for this purpose.  Hmmm... 50 fps is
  699.   actually TOO fast (at least for this particular sprite) so I slowed it
  700.   down to 25 fps.
  701.  
  702. * Successfully linked an asm routine to the C main program and shared
  703.   variables between C and asm.  Gee, it only took me 20 hours of mortal
  704.   combat with the Slinker to achieve this...  I eventually just set
  705.   data=far for EVERY module to get it to work right.  I'll fix it to
  706.   use near data later.
  707.  
  708. * Modified the makefile to take into account the new asm files.  BTW: the
  709.   compiling/linking process seems to go quite fast when I just make a little
  710.   change to move.tex or cmove.tex.  The makefile seems to really be doing
  711.   its job now. 8)
  712.  
  713. * Replaced all occurences of 
  714. (cell % GAMECOL) * 16 + 8;  and (cell / GAMECOL) * 16 + 8; and
  715. ((cell % GAMECOL) << 4) + 8 and ((cell / GAMECOL) << 4) + 8) WITH:
  716. xpixel[cell]                and ypixel[cell]
  717.  
  718. * Many small fixes to TeXnotes.
  719.  
  720.  
  721. BTW: My brain had begun thinking in C and I had planned to simply make my
  722. sprite-highlighter routine and my animator routine in carefully coded C.  I
  723. decided I'd do it in C and then MAYBE way later on convert the whole thing
  724. to asm.  So I wrote up my sprite-animator in C and then it wouldn't compile
  725. my 0b1000000000000001 numbers.  I asked numerous people on the net and they
  726. all said "C can't do binary numbers"  (!)  WTF!?  So I got REALLY mad at
  727. how lame C is because I like to SEE my and/or/xor masks visually in my
  728. program.  In fact I got so mad that I just rewrote the whole thing in asm
  729. and now I'm glad I did.  But don't worry, when we convert to another
  730. computer I can translate all the asm code to C no problemo amigo. 8)
  731. My sprite was in binary numbers because I designed it in Cygnus Ed
  732. Professional as a series of binary numbers.
  733.  
  734. * Animation Upgrade Plan:
  735.  
  736. * Phase I: Shifted the map over to the left edge of the screen so all
  737.   graphic writes are now word aligned.  The Blitter is a 16-bit processor.
  738.   The old system had the blitter doing the following things:
  739.   1) Read Source data of 1 word.
  740.   2) Read *2* destination words. (since they were unaligned)
  741.   3) Shift the source data over and mix it with the destination data and
  742.      then write out the *2* destination words.
  743.   That is a total of 5 Bus accesses!
  744.  
  745.   Now that I have word aligned everything the blitter just does:
  746.   1) Read Source data of 1 word.
  747.   2) Write destination data of 1 word.
  748.   Only 2 bus accesses!!  So the blitter operations are now more than 2.5x
  749.   as fast!  Unfortunately after factoring in CPU overhead it may work out
  750.   to only about 2x as fast.
  751.  
  752.   This was also neccessary for my upcoming assembly animator which will get
  753.   even more speed as a result of the even alignment.
  754.  
  755.   You can still tell where the edge of the map is because the
  756.   mouse pointer stops at the edge.  If that isn't good enough then just
  757.   tell me and I can make a 1-pixel-wide sprite that marks the edge.
  758.   I left you a 1-pixel edge on the top of the map. 8)
  759.  
  760. * Phase II: Static and empty cells are NO LONGER REDRAWN by the animator.
  761.   If it isn't animated then the animator doesn't need to draw it.  So on
  762.   average this doubles the speed of the animator.   In the WORST case it
  763.   will go the same speed as it used to go.  In the BEST case it goes about
  764.   238x faster!  On average it should cruise 2x as fast as before.
  765.  
  766.   In order for phase II to work, all cell effects routines that damage the
  767.   graphics of multiple cells are now modified to set RedrawAll=YES so the
  768.   animator will redraw all objects during the next cycle.  RedrawAll is a
  769.   bit misleading since it doesn't redraw empty cells at this time.
  770.   (Currently the game is so well-behaved that it doesn't need empty cells
  771.   to be redrawn.)
  772.  
  773.   I have implemented much of Phase II at this time but I have to send you
  774.   an update in 36 hours so I am putting it ON HOLD due to the fact that
  775.   updating cast.tex may be troublesome...  I just don't know yet.  This new
  776.   animation philosophy means that when the game modifies the graphics in a
  777.   cell then it should set them back to way they are supposed to be at the
  778.   end of the routine.  Routines cannot depend on the animator to redraw an
  779.   inanimate object.  Some routines in the game are set to work fine with
  780.   this new philosophy, other routines are ???
  781.  
  782. * Doubled the speed of the BoardEffect C code.
  783.  
  784. * Retargetable graphics upgrade: Retargetable graphics are needed so the
  785.   game can inherently work with 16x16 or 32x32 or 32x16 or 16x32 or even
  786.   64x64 cells.  This is needed for a variety of reasons and since my
  787.   xpixel[] and ypixel[] arrays have already done much of the work I may as
  788.   well just make the rest of the changes that are needed to complete this
  789.   new capability:
  790.  
  791. * Replaced all appropriate occurrences of 16 with CellWidth or CellHeight
  792.   and 8 with HalfCellWidth or HalfCellHeight in Cell.tex, move.tex,
  793.   cmove.tex and prog.tex and cast.tex.  I didn't touch info.tex.
  794.   I'll have to do that one when the day comes.
  795.  
  796.   You should look over TELEPORTIN and TELEPORTOUT in Cell.tex because I
  797.   think they need further adjustment to make them handle any size of cell.
  798.  
  799.   In the future don't use the constant 16.  Use CellWidth or CellHeight
  800.   instead.  Don't use 8.  Use HalfCellWidth or HalfCellHeight instead.
  801.   CellWidth, CellHeight, HalfCellWidth and HalfCellHeight are variables and
  802.   not #defined because we may someday have the capability of letting the
  803.   user choose his displaymode and his tilesize at run time.
  804.  
  805. * I talked to an Amiga guy about his favorite strategy games.  (He had no
  806.   idea that I was co-coder of Chaos)  He mentioned Chaos as one of his
  807.   favorite strategy games.  I asked him lots of questions about Chaos like
  808.   what are its good points and what are its bad points and what kind of
  809.   game is it?  And stuff like that. He said a lot of interesting things.
  810.   One of his main complaints was that the computer moved to slowly.  Well,
  811.   I had just been waiting for a real life gamer to complain about the speed
  812.   to justify spending some time looking over cmove.tex.  Now that I've
  813.   looked it over  Here is my report:
  814.  
  815. * Speeded up GetWizardWeight
  816.  
  817. * Speeded up ChooseDestination
  818.  
  819. * I just figured out how to speed up computer movement an additional 4x
  820.   but I doubt that I can get it programmed in before the Sunday Morning
  821.   deadline.
  822.  
  823. * I just spent 10 hours fiddling with slinker settings and recompiling and
  824.   adjusting code and moving data into __far and reading manuals but nothing
  825.   worked!  I could NOT get Chaos back to using near/far data again. So I am
  826.   giving up in frustration and I will try again in a few months when I know
  827.   more.  In the meantime, the makefile is already set to do data=far on
  828.   every module so at least the game works.
  829.  
  830. * I can't think of any reason not to be passing parameters in registers.
  831.   This is faster and takes less memory.  So I will now modifiy the makefile
  832.   to do parameters=register.  This should save us about 3k off the size of
  833.   the executable.  Chaos release is currently 235328 bytes
  834.   <Several hours later>  Geez... it kept giving errors about undefined
  835.   symbols and stuff....  Ok I FINALLY got it all figured out and it is
  836.   compiling properly.  Chaos is now 231892 bytes for a savings of 3436
  837.   bytes!  That works out to about 512 bytes per hour of work....
  838.  
  839. * I've now read the docs about saveds and I understand it now.  I can't
  840.   think of any reason why we need to compile the whole game with saveds.
  841.   Only the Animator Task needs __saveds in its definition (which it has had
  842.   for some time now.)  So I will now remove saveds from the makefile and
  843.   save about another 1k.  IF YOU KNOW OF ANY OTHER FUNCTIONS THAT NEED
  844.   __saveds THEN PLEASE JUST ADD THE __saveds keyword to their definition
  845.   and also tell me about the function so I'll know about it.  Thank you. 8)
  846.  
  847. * Chaos is now only 229696 bytes thus saving 2196 bytes!!!!
  848.  
  849. I assume we can save another 20k once we figure out how to start using near
  850. data again.
  851.  
  852. --------- SUNDAY DEADLINE HERE --- COULD NOT REACH YOU ---------
  853.  
  854. * All this time my HighlightSprite was messed up and nobody ever noticed
  855.   it.  But when I stared at it I noticed that the right hand side was
  856.   messed up somehow.  It turned out that the right side of frame 3 was
  857.   exactly the opposite of how it was supposed to be.  FIXED.
  858.  
  859. * I just found this: ftp.waikato.ac.nz  Maybe we could FTP in the future?
  860.   Then I wouldn't have to do that weird compress or whatever.
  861.  
  862. * I rewrote SqDistance in optimized assembly code.  It is now 11x as fast
  863.   as before.  C version took about 1834 cycles while mine takes only about
  864.   156 cycles.  Cycle times listed are for 68000.  I am hoping this will
  865.   translate into making the computer creatures move 4x as fast because
  866.   SqDistance is in the inner-innerloop and gets executed a LOT.
  867.  
  868. * Ok, I've gone all through cast.tex and made the changes to keep it
  869.   in sync with the new animation system.  CellEffect does not redraw the
  870.   cell at the end so the caller must redraw it if needed. (It usually is
  871.   but not always.)
  872.  
  873. * ReDrawCell now explicity redraws BLANK cells as BLANK cells.  So now it
  874.   will erase any damaged graphics.  It also does its work within an
  875.   Obtain/Release Semaphore pair.
  876.  
  877. * I was wandering through the program, implementing Phase II of the new
  878.   animation system when I found the following messed up code.
  879.   Check it out:  .... 30 minutes later... oops... I thought I'd found a
  880.   major bug.  But it turns out to just be messed up indentation.  I made
  881.   the necessary adjustments.
  882.  
  883. Collapse magic castles, dark citadels and magic woods as appropriate.
  884.  
  885. \begin{verbatim}
  886.     if (((id == MagicCastleID || id == DarkCitadelID) &&
  887.        (MSGRandom() % CASTLE_COLLAPSE) == 1) || (id == MagicWoodID  &&
  888.         GetWizardCode(i) != NOTHING && (MSGRandom() % TREE_COLLAPSE == 1))) {
  889.         int player;
  890.         player = GetWizardCode (i) - 1;
  891.         ObtainSemaphore (&BoardLock);
  892.         board[i].id = NOTHING;
  893.         ReleaseSemaphore (&BoardLock);
  894.         CellEffect (i, EXPLODE);
  895.         ObtainSemaphore (&BoardLock);
  896.         if (player >= 0) {
  897.             board[i].id = wizards[player].id;
  898.             board[i].flag = wizards[player].flag;
  899.             board[i].char_stat = wizards[player].char_stat;}
  900.         else {
  901.             board[i].id = 0;
  902.             board[i].flag = 0;
  903.             board[i].char_stat = InitialData[NOTHING];}
  904.             DrawCell (&NothingImage, i);
  905.             ReleaseSemaphore (&BoardLock);
  906.             board[i].oldid = NOTHING;
  907.             board[i].oldflag = NOTHING;
  908.             board[i].oldchar_stat=InitialData[NOTHING];
  909.             if (isWizard(i)) {
  910.                 sprintf (text_store,"New spell for %s", player_name[player+1]);
  911.                 WriteBottom (rastPort, text_store);
  912.                 AUDIOPlay (1000,10,1,20);
  913.                 wizards[player].BonusSpells += 1;
  914.                 wizards[player].BonusSpellsPick = 2 + MSGRandom() % 3;}
  915.          }
  916.     }
  917. }
  918.  
  919.  
  920. * I have changed the animator to do only _1_ Obtain/Release Semaphore pair
  921.   per update.  This saves 474 jsr/rts combos per frame resulting in a
  922.   significant speed increase in the animator task. 
  923.  
  924.   I traced through ObtainSemaphore and ReleaseSemaphore and counted the
  925.   cycles. All cycle times are from the 68000.
  926.  
  927. ObtainSemaphore Trace:
  928. 12    LEA    07583670,A0
  929. 20    MOVEA.L    0004,A6
  930. 18    JSR    FDCC(A6)
  931. 12    JMP    0XF82E50
  932. 16    ADDQ.B    #1,0127(A6)
  933. 16    ADDQ.W    #1,002C(A0)
  934. 8    BNE.B    0XF82E68
  935. 28    MOVE.L    0114(A6),0028(A0)
  936. 16    ADDQ.W    #1,000E(A0)
  937. 10    BRA.W    0XF82954
  938. 16    SUBQ.B    #1,0127(A6)
  939. 8    BGE.B    0XF82966
  940. 12    TST.B    0126(A6)
  941. 8    BGE.B    0XF82966
  942. 12    TST.W    0124(A6)
  943. 8    BMI.B    0XF82968
  944. 16    RTS
  945. TOTAL:
  946. 236 CYCLES!  *238*3=168504 cycles for a screen full of animated objects at
  947. a VERY low framerate of only 3 fps.
  948.  
  949.  
  950.  
  951. ReleaseSemaphore Trace:
  952. 12    LEA    07583670,A0
  953. 20    MOVEA.L    0004,A6
  954. 18    JSR    FDC6(A6)
  955. 12    JMP    0XF82EA6
  956. 16    ADDQ.B    #1,0127(A6)
  957. 16    SUBQ.W    #1,000E(A0)
  958. 8    BNE.B    0XF82EBE
  959. 20    CLR.L    0028(A0)
  960. 16    SUBQ.W    #1,002C(A0
  961. 8    BGE.B    0XF82EE0
  962.  
  963. 56    MOVEM.L    D0-D1/A0-A3,-(A7)
  964. 4    MOVEA.L    A0,A2
  965. 8    LEA    0010(A2),A0
  966. 12    MOVEA.L    (A0),A1
  967. 12    MOVE.L    (A1),D0
  968. 8    BEQ.B    0XF82F18
  969. 12    MOVE.L    D0,(A0)
  970. 6    EXG    D0,A1
  971. 16    MOVE.L    A0,0004(A1)
  972. 4    MOVEA.L    D0,A1
  973. 16    MOVE.L    0008(A1),D0
  974. 14    BCLR    #0000,D0
  975. 8    BNE.B    0XF82F70
  976. 4    TST.L    D0
  977. 8    BEQ.B    0XF82F20
  978. 4    MOVEA.L    D0,A1
  979. 16    MOVE.L    A1,0028(A2)
  980. 16    ADDQ.W    #1,000E(A2)
  981. 4    MOVEQ    #10,D0
  982. 18    JSR    FEBC(A6) ------------->
  983. 12    JMP    F82826
  984. 8    LEA    001A(A1),A0
  985. 20    MOVE.W    #4000,00DFF09A
  986. 16    ADDQ.B    #1,0126(A6)
  987. 20    MOVE.L    (A0),-(A7)
  988. 20    OR.L    D0,(A0)
  989. 16    MOVE.L    001E(A1),D1
  990. 6    AND.L    D0,D1
  991. 8    BNE.B    0XF82886
  992. 16    CMPI.B    #04,000F(A1)
  993. 8    BNE.B    0XF82896
  994. 14    AND.L    0016(A1),D0
  995. 8    BEQ.B    0XF82896
  996. 4    MOVE.L    A1,D0
  997. 12    MOVEA.L    (A1)+,A0
  998. 12    MOVEA.L    (A1),A1
  999. 12    MOVE.L    A0,(A1)
  1000. 16    MOVE.L    A1,0004(A0)
  1001. 4    MOVEA.L    D0,A1
  1002. 16    MOVE.B    #03,000F(A1)
  1003. 8    LEA    0196(A6),A0
  1004. 18    BSR.W    0XF819E6 -------->
  1005. 12    MOVE.B    0009(A1),D1
  1006. 12    MOVE.L    (A0),D0
  1007. 4    MOVEA.L    D0,A0
  1008. 8    BEQ.B    0XF819F8
  1009. 16    MOVE.L    0004(A0),D0
  1010. 16    MOVE.L    A1,0004(A0)
  1011. 12    MOVE.L    A0,(A1)
  1012. 16    MOVE.L    D0,0004(A1)
  1013. 4    MOVEA.L    D0,A0
  1014. 12    MOVE.L    A1,(A0)
  1015. 16    RTS ---------------------<
  1016. 14    CMPA.L    0196(A6),A1
  1017. 8    BNE.B    0XF82896
  1018. 16    SUBQ.B    #1,0126(A6)
  1019. 8    BGE.B    0XF828A4
  1020. 20    MOVE.W    #C000,00DFF09A
  1021. 12    MOVE.L    (A7)+,D0
  1022. 16    RTS----------------------------<
  1023. 60    MOVEM.L    (A7)+,D0-D1/A0-A3
  1024. 10    BRA.W    0XF82954
  1025. 16    SUBQ.B    #1,0127(A6)
  1026. 8    BGE.B    0XF82966
  1027. 12    TST.B    0126(A6)
  1028. 8    BGE.B    0XF82966
  1029. 12    TST.W    0124(A6)
  1030. 8    BMI.B    0XF82968
  1031. 16    RTS
  1032.  
  1033. 1164 TOTAL CYCLES! *238*3 = 831096 cycles!
  1034.  
  1035.  
  1036. 1 Obtain/ReleaseSemaphore pair takes 1400 cycles.
  1037. Since it should only take about 1800 cycles to draw one cell this has
  1038. nearly doubled the speed of the animatortask yet again.
  1039.  
  1040. If the board was filled with animated objects which were being redrawn at
  1041. the very slow speed of only 3 fps then that would take 999,600 cycles per
  1042. second on the A500.  That is about 14% of the total available CPU power
  1043. being constantly used just to execute Obtain/ReleaseSemaphore statements.
  1044.  
  1045.  
  1046. BUG: When you run out of spells in Texas Trash'em the game gets stuck.  You
  1047. can't choose a spell or exit the spell-choosing phase.  You are just stuck.
  1048.  
  1049. I played a test game on the 7.15909 Mhz 68000 and the computer casting of
  1050. trees was unbearably slow.  Once I find the code that controls this then
  1051. I'll see about speeding it up some.
  1052.  
  1053. * I just noticed that the animator is still animating at full speed even
  1054.   when the spell and creature information panels are being displayed.
  1055.   I had noticed a long time ago that the spell info screen is filled with
  1056.   text rather slowly on the 7.15909Mhz 68000 so I have adjusted the
  1057.   information panels to stop the animation while they are up.  This
  1058.   will speed up the display of text a bit plus lighten the multitasking load
  1059.   on the system while the gamer reads his spell description.  BTW: This is
  1060.   a good example of the clipping that the OS DrawImage routine does.  It
  1061.   clips the whole entire image and draws nothing when a full screen window
  1062.   is up.
  1063.  
  1064. * Made some corrections to the TeX of msg.tex.  Maybe I'll rewrite
  1065.   MSGrandom in asm for a 2x or 3x speed increase.  Woops, nevermind.  q is
  1066.   127773 which won't fit into a word.  The 68000 can only divide a longword
  1067.   by a word.  To divide a long by a long you must use an actual math
  1068.   routine so it may just as well be the C math routine. 8(  However if we
  1069.   ever made an 020+ version then I could easily make us an asm MSGrandom
  1070.   since the 020 and up can divide a long by a long.
  1071.  
  1072. * New function: WaitVBlank for display synchronized waiting.
  1073.  
  1074. ***** NEW INTRO
  1075. * Replaced old intro with "something more spectacular".
  1076. * Quadruple the resolution of the old intro.
  1077. * Same number of colors as the old intro (since the old one only used 8
  1078.   colors this was not hard 8) I only used 8 colors to conserve chipram and
  1079.   hopefully be able to include one of my Chaos Theme Songs along with the
  1080.   intro.
  1081. * Smooth Scrolling.
  1082. * Colorfading effect.
  1083. * The text has different colors and shadows each time for variety.
  1084. * ExtraLarge, easy to read, colorized fonts.
  1085. * Quadruple-Channel music played with the rather lame, buggy and
  1086.   system-unfriendly ptreplay.library.
  1087. * As far as strategy games go, the new intro-credits-presentation is fairly
  1088.   good but it is still quite lame compared to Action Games and
  1089.   Action/Strategy Games.
  1090. ***** END NEW INTRO
  1091.  
  1092. OOPS!  I was just about to add background music to the intro so I looked at
  1093. my filesizes: 410k, 550k, 393k, 250k.  Hmmm.. The intro music may just have
  1094. to require 1 meg of chipram.  Maybe the 250k one will fit.  The 250k one is
  1095. the simplest sounding one though.
  1096.  
  1097. I also have a SPECTACULARLY GOOD LOOKING 16color super-well-textured
  1098. ColorFont that we could use in the intro but the font is about 400k so I'll
  1099. probably just use it in the "2 Megs of chipram intro".
  1100.  
  1101. I couldn't do anything all day saturday or sunday due to lack of
  1102. electricity.
  1103.  
  1104. * PROBLEM:
  1105.   Games which require fonts to be copied into FONTS: have the following
  1106.   drawbacks:
  1107.   1. A lot of people have a FULL SYS: so there is NO room for new fonts.
  1108.   2. It makes installation more difficult.  Its just one more file that
  1109.      someone might forget to copy.
  1110.   3. When a person deletes the game from their harddrive, the stupid fonts
  1111.      are still in the FONTS: cluttering up the dir.
  1112.   4. I've played MANY games from aminet which required copying fonts into
  1113.      FONTS:  and I've played several games from aminet which required me to
  1114.      copy NOTHING but the game drawer onto my harddrive.  I always get a
  1115.      positive feeling when I just click on the gamedrawer of the game and
  1116.      drag it onto my harddrive and VOILA I am done!  That is how a game
  1117.      should be; easy to start up without even the TINIEST hassle.
  1118.   5. There are LOTS of lamers out there who are not good at copying files
  1119.      anywhere and just end up screwing things up.
  1120.   6. There are LOTS of other lamers out there who just won't bother with a
  1121.      game if they have to manually copy something.  These people will just
  1122.      never play our game.  Remember, there are lots of "ordinary" people
  1123.      out there who are not "into" computers like we are.
  1124.   7. I find it annoying when games have to have files copied into FONTS:,
  1125.      LIBS:, DEVS:, L: and S:
  1126.   8. After years of using my Amiga, my HD (especially FONTS: and S:) are
  1127.      cluttered up with tons of files which now serve no purpose since I 
  1128.      deleted the game years ago.
  1129.  
  1130.   9. Games (and all other programs) which put config files in S: are annoying.
  1131.      They should keep all their config files in their own damn directory.
  1132.  10. Games (and all other programs) which edit your startup-sequence to add an
  1133.      assign to their dir or subdir are HIGHLY annoying.  Let's see, I paid
  1134.      $400.00 for a state-of-the-art desktop publishing program with an 800k
  1135.      main executable and they couldn't include a few lines of code to do their
  1136.      own freaking assigns?!?!?!  Or find their files on their own some
  1137.      other way?!?!?!
  1138.  
  1139.  11. I guess you are aware that programs which add assigns to your
  1140.      startup-sequence are VERY common in the Amiga community.  I've never
  1141.      liked this because when you go to delete the program from your HD, YOU
  1142.      CAN'T!  You have to UNassign the assigns THEN delete the program
  1143.      and/or you have to edit your startup-sequence.  These are things that
  1144.      a gamer person should not EVER have to do.  Indeed, most gamers don't
  1145.      know HOW to do such things, that's why they bought Sega Genesis and
  1146.      Nintendo machines.
  1147.  12. Ideally, a game should be totally self-contained.  Self-contained
  1148.      games are just SO easy and fun to install and play.
  1149.  
  1150.  
  1151.     I haven't worked out how to make Chaos be completely self-contained and
  1152.     I don't know yet if such a goal is desirable for our game but all the
  1153.     problems MUST be eliminated.
  1154.  
  1155. * PROBLEM:
  1156.   I tried to open "fonts/union.font" (so it would just load the font from
  1157.   the current dir that chaos was running in) but it absolutely WOULD NOT
  1158.   WORK.  So I was stuck doing what most everybody else does and that is
  1159.   requiring the font to reside in FONTS:
  1160.  
  1161. * SOLUTION:
  1162.   After spending all day experimenting and talking to different programmers
  1163.   and doing research, here is what I worked out:
  1164.   1. The programmers all told me the same thing:
  1165.      A) Ditch 1.2/1.3 and just require OS2.04+  (indeed this would have
  1166.         made things MUCH easier.)
  1167.      B) Under 2.04+ you can just use PROGDIR: or you can just use the
  1168.         GetProgramDir function.
  1169.   2. But since I want to keep Chaos playable on every Amiga for as long as
  1170.      possible and since there are a lot of people who still use 1.3 I came
  1171.      up with a way that will work on all amigas and OS revisions.
  1172.  
  1173.   3. I have implemented some simple code at the beginning of CommenceChaos
  1174.      to determine the currentdir and then Assign ChaosGame: to that dir.
  1175.      So now we can load fonts from "ChaosGame:fonts/fontname.font" and
  1176.      everything works great!
  1177.   4. This nifty way of doing things will become more and more important in
  1178.      the future as we utilize more fonts in the game.
  1179.   5. I presume that this has also solved the problems of loading my
  1180.      ChaosThemeSongs, sound effects and other things.
  1181.   6. Chaos doesn't require its gamefonts to reside in FONTS:, the user
  1182.      doesn't have to make any assigns and Chaos does not have to edit the
  1183.      s:user-startup.
  1184.  
  1185.  
  1186. I don't know what to do about libs:  I really like having libraries in my
  1187. libs: dir but Chaos requires 2 different versions of reqtools.library.  It
  1188. needs one version for OS 1.3 and another version for OS2.04+.  I guess
  1189. we'll just have to make an install script maybe...  I'll worry about it
  1190. later.
  1191.  
  1192. * 2 new asm functions: pal and ntsc.  To switch into either video mode
  1193.   instantly on any ECS Agnus equiped Amiga. Which means _any_ Amiga
  1194.   manufactured in the 1990's plus some of the Amigas from 1989 plus anybody
  1195.   who upgraded their old Amigas to an ECS Agnus.
  1196.  
  1197. * Computer Tree Casting Speedup Plan:
  1198. * 1. Getxy(c,&x,&y) asm routine which is around 11x as fast as
  1199.      x = cell % GAMECOL;
  1200.      y = cell / GAMECOL;
  1201.      Replaced the above code in CheckTree with Getxy(c,&x,&y);
  1202.  
  1203. ** Referring now to DoComputerCast
  1204. * 2. Replaced 5 occurrences of isDead(i) macro with the isdead simple
  1205.      variable.
  1206.  
  1207. * 3. REPLACED:
  1208.        my = i / GAMECOL - cell / GAMECOL;
  1209.        mx = i % GAMECOL - cell % GAMECOL;
  1210.        if ((float)(mx * mx + my * my) >= d * d) continue;
  1211.      WITH:
  1212.        if ((float)SqDistance(i,cell) >= d * d) continue;
  1213.  
  1214. * 4. Rearranged the order of the tests to work faster for trees.
  1215. * 5. Logically avoided 5 of the if tests.
  1216. * 6. Replaced 9 occurrences of code in cast.tex with Getxy();
  1217.      1 in prog.tex, 7 in cmove.tex, 8 in move.tex.
  1218.  
  1219. I replaced the following form of code sequences.  Is this the proper usage
  1220. of the & operator in this case???  If this is wrong then please tell me.
  1221.                 Getxy(c,&wizards[WarpWizard[i]-1].x,&wizards[WarpWizard[i]-1].y);
  1222. //                wizards[WarpWizard[i] - 1].x = c % GAMECOL;
  1223. //                wizards[WarpWizard[i] - 1].y = c / GAMECOL;
  1224.  
  1225.  
  1226.  
  1227. * 7.11 YIPERS!  GAMESPACE is not a variable.  It isn't a constant either! 
  1228.      It is a #defined _expression_!!!!!
  1229.  
  1230.     #define GAMESPACE    (GAMEROW * GAMECOL)
  1231.  
  1232.     GAMECOL is a constant while GAMEROW is a variable.
  1233.     This means that all the zillions of loops like:
  1234.     for (i = 0; i < GAMESPACE; i++)
  1235.     are actually having to _evaluate_ GAMESPACE each time through the loop!
  1236.     That means that the cycles of one of those complicated C multiplication
  1237.     routines are being wasted each time through the loop.
  1238.     This was slowing down LOTS of loops.  Even the loop for the animator
  1239.     uses GAMESPACE.
  1240.  
  1241. * Above problem FIXED and speeded up.
  1242.  
  1243. GetCell(x,y); in ASM!
  1244. I just looked at the C-generated ASM code for GetCell(x,y) and I could
  1245. definitely make an asm version that is about twice as fast BUT the reason
  1246. for this is simply that C is doing a full 32-bit multiply because x,y are
  1247. defined as ints instead of words.  So now I must decide whether to try to
  1248. switch the entire program over to using words for x,y coords or just
  1249. writing the asm routine to take the x,y ints and use them as words.
  1250. Do you have any opinions on this?
  1251.  
  1252. * Test GetCell((UWORD)x,(UWORD)y); to see the code that is generated.
  1253.   The Trouble is that GAMECOL is defined as an int. hmm....
  1254.   Change macro to (UWORD)GAMECOL and see what happens.
  1255.  
  1256.   OK I changed the GetCell macro to:
  1257.   #define GetCell(x,y)     (((UWORD)y) * (UWORD)GAMECOL + ((UWORD)x))
  1258.  
  1259.   And the C compiler generated MUCH better code; a good 2x to 3x speed
  1260.   increase. It saved a bsr/rts and *2* multiply instructions plus more!
  1261.   Here is a listing of the new MUCH improved code:
  1262.        | 144C  202F 0084                      MOVE.L      0084(A7),D0
  1263.        | 1450  2239  0000 001A-02             MOVE.L      02.0000001A,D1
  1264.        | 1456  C1C1                           MULS.W      D1,D0
  1265.        | 1458  2205                           MOVE.L      D5,D1
  1266.        | 145A  7400                           MOVEQ       #00,D2
  1267.        | 145C  3401                           MOVE.W      D1,D2
  1268.        | 145E  D082                           ADD.L       D2,D0
  1269.        | 1460  2C00                           MOVE.L      D0,D6
  1270.  
  1271.   Now I will test:
  1272.   #define GetCell(x,y)     (((UWORD)y) * (UWORD)GAMECOL + (x))
  1273.   This should allow us to save 2 additional machine instructions.
  1274.        | 144C  202F 0084                      MOVE.L      0084(A7),D0
  1275.        | 1450  2239  0000 001A-02             MOVE.L      02.0000001A,D1
  1276.        | 1456  C1C1                           MULS.W      D1,D0
  1277.        | 1458  D085                           ADD.L       D5,D0
  1278.        | 145A  2C00                           MOVE.L      D0,D6
  1279.   WOW!  Check that out!  It saved *3* instructions! (6 bytes)
  1280.   57 occurences of GetCell * 6 bytes=342 additional bytes saved.
  1281.   Maximum efficiency achieved!  No need for an asm version.
  1282.  
  1283.  
  1284.  
  1285. * Speed up MSGRandom:  Here is the old code (34 lines)
  1286.        | 0028  2039  0000 0000-01             MOVE.L      01.00000000,D0
  1287.        | 002E  223C 0001 F31D                 MOVE.L      #0001F31D,D1
  1288.        | 0034  6100  0000-XX.1                BSR.W       __CXD33
  1289.        | 0038  2001                           MOVE.L      D1,D0
  1290.        | 003A  E980                           ASL.L       #4,D0
  1291.        | 003C  9081                           SUB.L       D1,D0
  1292.        | 003E  2400                           MOVE.L      D0,D2
  1293.        | 0040  E582                           ASL.L       #2,D2
  1294.        | 0042  D480                           ADD.L       D0,D2
  1295.        | 0044  EB82                           ASL.L       #5,D2
  1296.        | 0046  D481                           ADD.L       D1,D2
  1297.        | 0048  2002                           MOVE.L      D2,D0
  1298.        | 004A  E780                           ASL.L       #3,D0
  1299.        | 004C  9082                           SUB.L       D2,D0
  1300.        | 004E  2F40 0008                      MOVE.L      D0,0008(A7)
  1301.        | 0052  2039  0000 0000-01             MOVE.L      01.00000000,D0
  1302.        | 0058  223C 0001 F31D                 MOVE.L      #0001F31D,D1
  1303.        | 005E  6100  0000-XX.1                BSR.W       __CXD33
  1304.        | 0062  2200                           MOVE.L      D0,D1
  1305.        | 0064  E581                           ASL.L       #2,D1
  1306.        | 0066  9280                           SUB.L       D0,D1
  1307.        | 0068  2401                           MOVE.L      D1,D2
  1308.        | 006A  E982                           ASL.L       #4,D2
  1309.        | 006C  9481                           SUB.L       D1,D2
  1310.        | 006E  D482                           ADD.L       D2,D2
  1311.        | 0070  9480                           SUB.L       D0,D2
  1312.        | 0072  D482                           ADD.L       D2,D2
  1313.        | 0074  9480                           SUB.L       D0,D2
  1314.        | 0076  E582                           ASL.L       #2,D2
  1315.        | 0078  D480                           ADD.L       D0,D2
  1316.        | 007A  E582                           ASL.L       #2,D2
  1317.        | 007C  202F 0008                      MOVE.L      0008(A7),D0
  1318.        | 0080  9082                           SUB.L       D2,D0
  1319.        | 0082  2E00                           MOVE.L      D0,D7
  1320.  
  1321. Here is the new code after changing the C code to use DIVL: (33 lines)
  1322.        | 0028  2039  0000 0000-01             MOVE.L      01.00000000,D0
  1323.        | 002E  223C 0001 F31D                 MOVE.L      #0001F31D,D1
  1324.        | 0034  486F 000C                      PEA         000C(A7)
  1325.        | 0038  6100  0000-XX.1                BSR.W       @ldiv
  1326.        | 003C  584F                           ADDQ.W      #4,A7
  1327.        | 003E  202F 0010                      MOVE.L      0010(A7),D0
  1328.        | 0042  2200                           MOVE.L      D0,D1
  1329.        | 0044  E981                           ASL.L       #4,D1
  1330.        | 0046  9280                           SUB.L       D0,D1
  1331.        | 0048  2401                           MOVE.L      D1,D2
  1332.        | 004A  E582                           ASL.L       #2,D2
  1333.        | 004C  D481                           ADD.L       D1,D2
  1334.        | 004E  EB82                           ASL.L       #5,D2
  1335.        | 0050  D480                           ADD.L       D0,D2
  1336.        | 0052  2202                           MOVE.L      D2,D1
  1337.        | 0054  E781                           ASL.L       #3,D1
  1338.        | 0056  9282                           SUB.L       D2,D1
  1339.        | 0058  202F 000C                      MOVE.L      000C(A7),D0
  1340.        | 005C  2400                           MOVE.L      D0,D2
  1341.        | 005E  E582                           ASL.L       #2,D2
  1342.        | 0060  9480                           SUB.L       D0,D2
  1343.        | 0062  2602                           MOVE.L      D2,D3
  1344.        | 0064  E983                           ASL.L       #4,D3
  1345.        | 0066  9682                           SUB.L       D2,D3
  1346.        | 0068  D683                           ADD.L       D3,D3
  1347.        | 006A  9680                           SUB.L       D0,D3
  1348.        | 006C  D683                           ADD.L       D3,D3
  1349.        | 006E  9680                           SUB.L       D0,D3
  1350.        | 0070  E583                           ASL.L       #2,D3
  1351.        | 0072  D680                           ADD.L       D0,D3
  1352.        | 0074  E583                           ASL.L       #2,D3
  1353.        | 0076  9283                           SUB.L       D3,D1
  1354.        | 0078  2E01                           MOVE.L      D1,D7
  1355. The line saved was the expensive subroutine call to perform the 2nd
  1356. division operation.
  1357.  
  1358. I traced through both versions real quick and it looks like they are both
  1359. the same speed due to the ldiv routine containing 2 subroutine calls.  It
  1360. looks like ldiv does the exact same thing as x / y ... x % y 
  1361. This is probably a case where ldiv is _supposed_ to be faster but the
  1362. compiler writers never made an optimized version.  I will leave the
  1363. original code intact for now and maybe I will do a detailed cycle count
  1364. later.
  1365.  
  1366. * Changed:
  1367.     if ((isGrowth (i) || isCloaked (i)) && spell == CloakID)          continue;
  1368.     if ((isUndead(i)) && spell == LichID)              continue;
  1369.     if (!(isUndead(i)) && (castinfo & CAST_UNDEAD))    continue;
  1370.  
  1371.   To:
  1372.     if (spell==CloakID && (isGrowth (i) || isCloaked (i)))   continue;
  1373.     if (spell==LichID && (isUndead(i)))                      continue;
  1374.     if ((castinfo & CAST_UNDEAD) && !(isUndead(i)))          continue;
  1375.  
  1376.   Result = faster code = saves the execution of 27 instructions.
  1377.  
  1378.  
  1379. * NOW, after all that, computer treecasting should be noticeably faster on
  1380.   the A500 than before.
  1381.  
  1382.   Growth Rates are still a bit too high but especially Violet Fungi so:
  1383. * I just changed SPUD_CONSTANT from 5 to 6 and FUNGI_RATE from 30 to 40 in
  1384.   at attempt to keep growths from taking over the world.  Now I've played
  1385.   some test games with it like this and it seems just GREAT!  Now it is
  1386.   working the way I envisioned it!  (Except I haven't tested Purple Fungi
  1387.   yet so I don't know about them.)
  1388.  
  1389.   Can't see the Ogre Mage shot most of the time so:
  1390. * I inserted a WaitTOF(); into the BirdShot routine to hopefully fix this.
  1391.   The BirdShot uses BLOB_WEAPON which is the easiest to draw.  I think it
  1392.   had just been drawing to fast.
  1393.  
  1394. * BUG: Bird Lord shot me and it didn't redraw my cell. (I was invulnerable
  1395.   at the time, if that makes any difference)
  1396.   Bird Lord shot another creature and it was redrawn properly.
  1397.   NOW FIXED.
  1398.  
  1399. * The 2nd voice sample in ChaosTheme1 just didn't sound right so I deleted it
  1400.   and saved 49k.  Now my small themesong is only 201k.  Hopefully that will
  1401.   fit into a 512k chipram intro.
  1402.  
  1403.  
  1404. **** After months of not playing a single serious game I decided to play a
  1405.      real game.  Here are the results of the Tuesday Playtesting.
  1406.  
  1407. A wizard with lots of creatures and a doube-triple put all 6 of his armours
  1408. on the _same_ creature even though he had other creatures that were
  1409. wounded.  He wasted at least half of his armours.
  1410.  
  1411. Same game later on...  Right now there is a DEAD pegasus.  It says dead and
  1412. it has the dead image.  Yet it has life and people are attacking it.  ??
  1413. It was next to a shadowwood so maybe when a ShadowWood kills something this
  1414. is what happens?  This was probably caused by a growth and is probably
  1415. FIXED now.
  1416.  
  1417.  
  1418. Fire covered up my wizard who was on a horse but it didn't kill my team and
  1419. it didn't put my creatures to sleep and I could still play (but without my
  1420. wizard).
  1421. When I click on the cell that I was on I can see my powerups just like as
  1422. if I was in a tree.
  1423. Next turn I killed the fire with my creatures and uncovered my wizard and
  1424. everything was back to normal.
  1425. ****** END OF TUESDAY PLAYTEST.
  1426.  
  1427.  
  1428. ********** Thursday Playtesting. **********
  1429. * Thursday: Relatives came over and we played 2 games of chaos.  The
  1430.   first one only lasted about 5 turns because my tree collapsed and I was
  1431.   simultaneously attaced by 2 Platinum Dragons and 1 Golden Dragon and they
  1432.   didn't want to play after I was dead.  The second game only lasted 5
  1433.   turns also because the electricity went off. 8(  Here are the BUGS we
  1434.   found:
  1435.  
  1436. * HighlightSprite kept highlighting some tree each time it was Matt's turn.
  1437.   (he was player 3)  No big deal, it just looks funny.  We kept making
  1438.   jokes that he must have a "Magic Owl" in that tree or something. FIXED.
  1439.  
  1440. * Independent Spiderwebs didn't show up at first due to no ReDrawCell
  1441.   command.  FIXED.
  1442.  
  1443.   2 different Computer Wizards cast CLOAK and then aborted the spell
  1444.   because they were in a tree and they had no creatures yet.
  1445.  
  1446.   They all agreed that the statnumbers should be more uniform.  Like all
  1447.   0-7 or all 0-15 or all 0-63. (or at least nearly all the same)
  1448.   This subject was brought up because this was the first time they had ever
  1449.   seen the numbers on the info panel.  They _really_ liked that.
  1450. *********** End of Thursday Playtesting ****
  1451.  
  1452. FRIDAY == 3 WEEK DEADLINE.... Did not hear from you.
  1453.  
  1454. **** Friday Playtesting:
  1455.  
  1456. * When a growth no longer covers a dead body the body becomes "unalive"
  1457.   FIXED.
  1458.  
  1459. Computer wizards aborted Combat, Cloak, Raise Dead.
  1460.  
  1461. A Computer-controlled wizard just mounted an independent Nightmare!
  1462. But then someone killed the nightmare so I never got a chance to look at it
  1463. on the info screen.  Maybe the explanation is that the wizard just subverted
  1464. it when I wasn't looking?
  1465.  
  1466. 4th from the bottom, 7th from the right, the green ooze is being drawn 1
  1467. pixel too far down.  Cell coords must be off for that cell.
  1468. it is DEFINITELY being redrawn 1 pixel too low.
  1469.  
  1470. Sometimes the blob is drawn off by about 3 pixels.
  1471.  
  1472. I moved my wizard into this strange square and at first it drew it
  1473. correctly but then it moved it down 3 pixels.   Strangness.
  1474. At this point the xpixel[] and ypixel[] arrays are working but the
  1475. ancol[]/anrow[] arrays got corrupted somehow.  There must be some bug that
  1476. writes out some data to a place it isn't supposed to.  Possibly it does a
  1477. +=3 or a +=4 to account for the 3 or 4 pixel offset.
  1478. But there are no occurrences of +=3 or += 3 8(
  1479. Now that I think about it, at first it was off by 1 so maybe it was several
  1480. +=1 operations somewhere.  This is all probably related to the wizard with
  1481. LichLord being covered by my green blob.
  1482. Whatever bug caused this could easily be causing those spurious crashes.
  1483. The game hasn't crashed on me in a very long time.
  1484.  
  1485.  
  1486. Blob covered up computer wizard and "killed" him but the game didn't end
  1487. and his powerups show when I click on that blob. This might be because the
  1488. computer wizard in question has LichLord.
  1489.  
  1490. Next Turn:
  1491. WOW! Now the covered wizard just cast invulnerability on himself.
  1492. He can't attack or move though, apparently.
  1493.  
  1494. Next Turn:
  1495. Now he just vengeanced my elephant!
  1496.  
  1497. Next Turn:
  1498. Now he cast a Spectre!  And he is still covered up by the green blob.
  1499.  
  1500. As far as I can tell this is exactly the way it is suposed to work due to
  1501. him having LichLord.  I have no complaints.  It is just freaky. 8)
  1502. **** END Friday Playtesting.
  1503.  
  1504. Sunday: Tried to make an autobooting version of Chaos for 1.3.  I've done
  1505. this before and it always worked but now it loads then crashes.  I don't
  1506. know why but it might be because of that stupid ptreplay.library.
  1507. I went to an awful lot of trouble to avoid using OS2.0+ functions so that
  1508. it would work on all Amigas.
  1509.  
  1510. Ok, I just tested it and it DEFINITELY is the ptreplay.library that is
  1511. causing the crash on the 68000.
  1512.  
  1513. Monday-Tuesday Job Fair.
  1514.  
  1515. Tuesday Night:
  1516. * Speeded up WeaponEffect
  1517. * Speeded up ThreeBeam
  1518.  
  1519. * On a screenfull of creatures I often can't spot the victim of a
  1520.   DarkPower/Justice/Exorcise/Vengeance so now the victim is HighLighted.
  1521.  
  1522.  
  1523. 1 week goes by...
  1524.  
  1525. Tuesday Morning: Begin version 1.81
  1526. * Improved the Docs to be in sync with the new version 1.8 features.
  1527.  
  1528. * Acquired the OctaMED/RBF software play routines directly from
  1529.   Ray Burt-Frost himself.  I have no idea if I am actually going to use
  1530.   any of it though.
  1531.  
  1532. * Put my Lame old icon into the distribution.
  1533.  
  1534. 1 week goes by...
  1535.  
  1536. Tuesday Morning:
  1537. * Fixed off-center WizardExplode.
  1538. * Changed descriptions of Dark Power, Exorcise, Justice, Vengeance,
  1539.   Consecrate, Invert and Brain Boost.
  1540. * Inserted CheckPixelArrays(); code in the beginning and ending of most
  1541.   functions to try to find that screwed up mysterious bug.
  1542.  
  1543. Violet Fungi growth rate STILL WAY TOO HIGH.
  1544. * I have now instituted a new growth formula which will hopefully make the
  1545.   growths do what we wanted.  And I put SPUD_CONSTANT back down to 5 like
  1546.   it used to be.
  1547.  
  1548.  
  1549. On AnRow check it got an error at x=2.
  1550. AnRow[2]=0 but somehow AnRowBackup[2]=161!!!!
  1551. AnRow[3]=7 but somehow AnRowBackup[3]=65 !!!!
  1552. AnRow[4]=0 but somehow AnRowBackup[4]=193!!!!
  1553. AnRow[5]=0 but somehow AnRowBackup[5]=97 !!!!
  1554.  
  1555. Detected on first line of ReDrawCell, called from cMoveNonEngaged in cmove.c line 316
  1556. Power went out.  Start over.
  1557.  
  1558.  
  1559. 5 hours later... Bug detected again.  This time an Elemental is highlighted.
  1560. AnRow[9]=162  but AnRowBackup[9]=161
  1561. AnRow[10]=833 but AnRowBackup[100=65
  1562. Called from Reinstate move.c 248 (cell param=224 wizard_warn=0 board[cell].id=59)
  1563.  which was called by move.c Combat line 539 (defence=224)
  1564.  
  1565. * Sheesh!  I finally tracked it down completely.
  1566.   It turns out to be a bad subscript error.
  1567.   The trouble was with granting a bonus spell to the independents upon
  1568.   killing a tough creature.  In this instance an Independent Elemental
  1569.   killed a Golden Dragon and so a bonus spell was marked in
  1570.   wizards[player-].BonusSpells But wizards doesn't have that many elements
  1571.   (9-1)=8 and wizards highest element was 7.
  1572.   *** NOW FIXED *** by increasing the size of wizards by 1.
  1573.  
  1574.   Here is the code that triggered the bug:
  1575.     if ((bonus = board[defence].char_stat.BonusSpellPick))
  1576.         {
  1577.         wizards[player - 1].BonusSpells += 1;
  1578.         wizards[player - 1].BonusSpellsPick += bonus;
  1579.         AUDIOPlay (1000,10,1,20);
  1580.  
  1581. * Trying out a new growth formula.
  1582.  
  1583. * You will notice that there are tons of calls to CheckPixelArrays();
  1584.   I don't want to go through and delete all these calls because I intend to
  1585.   use these calls to check for other corrupted variables.  So if you don't
  1586.   like the way it slows your 25Mhz 030 down to 7Mhz 000 speed then you can
  1587.   just comment out all the code inside the function itself; making it a
  1588.   null function or perhaps we could use conditional compiling?  Smake dev
  1589.   compiles those lines while smake release doesn't?
  1590.  
  1591. * I just came in the room and looked at the screen and I noticed something:
  1592.   The graphics seemed much more appealing than they used to be.  The screen
  1593.   is filled with all sorts of little animated critters  plus loads of webs
  1594.   and some earthquakes.  It just all looks enticing and interesting
  1595.   somehow.  All the extra movement from the faster frame rate makes
  1596.   everything more exciting.
  1597.  
  1598. Monday:
  1599. * Allegedly fixed the bug where computer wizards cast Raise Dead on
  1600.   growths.
  1601.  
  1602. * Allegedly fixed the problem of Computer Wizards casting Armour on
  1603.   creatures with max life.
  1604.  
  1605. ================== End Version 1.8x  ===============================
  1606. ================== Begin Version 1.9 ===============================
  1607. --- Star of changes made by SAI ---
  1608. * Incorporated new image data.
  1609. * Added C image drawing program, to compile to a "smake image"
  1610. * Modified lmkfile and makechaos to generate my chaos font
  1611. * Added the following new spells:
  1612.   Derro, Mud Man, Spriggan, Agathion, Annis, Azer, Banderlog,
  1613.   Bodak, Cat Lord, Jann, Marid, Shade, Dao, Bandit, Hybsil,
  1614.   Fire Bat, Shadow Dragon, Spectator, Crimson, Drelb, Haunt,
  1615.   Juju, Solar, Quickshot, Discard, Boil, Passage.
  1616. * Note, I could find not evidence of you changing the descriptions
  1617.   of Invert, Justice and so on. I assume you did it in pool.txt
  1618.   but apart from my new spells no significant differences could
  1619.   be found between the files.
  1620. * Fixed the graphics for the golden and platinum dragon.
  1621. * Played a game; quickly remembered that I hadn't finished the coding
  1622.   for all my new spells. The image for Quickshot has some how got
  1623.   inverted, very strange. There were still lots of dead wizards
  1624.   lying about the screen. A cloaked sleeping dragon did not appear
  1625.   cloaked on the screen. The program crashed when a manticore shot
  1626.   a magic wood tree.
  1627. * Made a change in move.tex hopefully to stop dead wizards.
  1628. * Added the SPRITES flag to the Chaos screen.
  1629. * Discovered that CHAOSANIM is causing a huge number of enforcer
  1630.   violations. I suspect this may be because there is an unbalanced
  1631.   ReleaseSemaphore in the program. It seems to start happening
  1632.   after a wizard dies. I removed my changes, but it didn't improve
  1633.   the situation.
  1634. * My monitor started flickering on an off, so I quickly made up an
  1635.   archive of what I had done in case it blows up.
  1636. * Completed the preliminary coding for the spell manager for creatures.
  1637. * Completed spell files up to Stone Golem (it is taking a while to do
  1638.   each one, but I figure it will be helpful in the long run).
  1639. * Perhaps the crashes are due to problems accessing HighLight variables.
  1640. * Fixed a bug wherby a dead wizard with the "Uncertainity" spell could
  1641.   result in dead creatures being case as if they were alive.
  1642. * Allegedly modified te freeze spell to work on independents.
  1643.   -JC tested this and it really works.
  1644. * Major Discovery: If I boot from a floppy by-passing my usual startup
  1645.   then the game worked much better in that JC sprite appeared. Therefore,
  1646.   I am going to have to investigate my startup sequence to find what
  1647.   causes this.
  1648. * Done spell files up to and including vampire.
  1649. * Completed spell files for all objects on the board.
  1650. * Whew, I have just finished making spell files for all our
  1651. spells (all 255 of them, now I added my new ones). The next
  1652. one should be interesting since any byte quantities hanging
  1653. around related to spells might break. Well, I won't be
  1654. adding any more for a little while anyway.
  1655. * Now trying to incorporate changes.
  1656. * Change the ordering of spells by swapping LichLord with Mutate
  1657.   (so that all computer assistance spells come after consecrate).
  1658. * Deleted initial_data, names, and speech from prog.tex
  1659. * Deleted chaos.prb and ranking information from spell.tex
  1660. * Deleted castinfo and computer assist arrays from cast.tex
  1661. * Made appropriate changes to make file.
  1662. * Now testing the spell manager. Having a few minor problems with the
  1663.   script I wrote. Added a FAILAT to stop if halting for no real
  1664.   reason.
  1665. * Deleted reincarnation table from move.tex.
  1666. * Deleted index.h pool.txt makedata.txt from archive.
  1667. * Now trying to remake entire game from archive. Problems: changed
  1668.   targets for info.o. Fixed problem with index.h. There is a problem
  1669.   with makedata.txt, for testing overcame by deleting lines. It is
  1670.   caused by bad referencing of statics. I will have to change the
  1671.   spell manager to cope with this.
  1672. * OK it all compiled and I proceeded to play a game. The was obviously
  1673.   a problem reading "chaos.prb" because all the spells were unusual ones.
  1674.   Fixed that problem. But then the game crashed just after a wizard died.
  1675.   Suspecting my fix to stop dead wizards I have temporarily disabled it.
  1676.   The whole problem of killing wizards needs a good going over and
  1677.   rationalization.
  1678. * Eventually the spell manager could be modified to print nice tables
  1679.   of creature abilities for inclusion in the manual.
  1680. * Fixed alignment of first set up screen.
  1681. * Made the game load my font from a local directory by following JC
  1682.   example. However, I noticed you used FPB_DISKFONT instead of
  1683.   FPF_DISKFONT (I wonder who is right). I've left it for the moment.
  1684.   I wonder if this could have something to do with SetSoftStyle bug.
  1685. * Fixed some bugs to do with scoring.
  1686. * Allegedly changed Texas'em so that when less than six spells remain
  1687.   no discard is required. This probably needs some sound to stop people
  1688.   clicking on each others spells. Tested OK.
  1689. * Added variant spider webs, this has pushed the number of spells over
  1690.   255 and some problems might occur.
  1691. * In testing I have observed a number of Enforcer hits corresponding
  1692.   to long reads. Reasons remain unknown.
  1693. * Fixed the loading/saving problem. It was caused by a single line
  1694.   missing from the start.tex file (InitLoad();)
  1695. * Added some mechanism for a turn counter. There is no warning that
  1696.   the game is about to end, also the scores aren't shown at the end.
  1697. * Replaced About menu.
  1698. * Added turn counter and discarding flag to the save file.
  1699. * Fixed a bug relating to the Dao.
  1700. * Elimited the single pixel blue line from the top of the screen.
  1701. * Replaced the new game menu.
  1702. * Completed implementation of the discard spell.
  1703. * Completed implementation of the quickshot spell (image still revesed tho).
  1704. * Just noticed that team scoring is broken. Something I changed here
  1705.   is screwed up.
  1706. * Fixed screen clearing when loading a saved game.
  1707. * Discovered a potential problem with the semaphore in Reinstate, this
  1708.   makes sense for the causes of all my recent crashes, attempting fix.
  1709. * Split the WeaponEffect procedure into two parts so it is more versatile
  1710.   (planning to use it in the Quit menu).
  1711. * Replaced the quit menu.
  1712. * Only the file menu now relies on reqtools, and will continue to do
  1713.   so in the mean time.
  1714. * Since it is possible that JC will lose account I am now making a new
  1715.   archive and testing a complete remake. If it works I send it.
  1716.  
  1717.  
  1718. * Rewrote the Reinstate function, thereby eliminating KillWizard,
  1719.   Reincarnate and KillElemental.
  1720. * Fixed yet another bug to do with discarding.
  1721. * Fixed a problem relating to the Eartquake and my change to the Reinstate
  1722.   function
  1723. * Incorporated JC font changes.
  1724. * Incorporated JC spell description changes.
  1725. * Made the solar always move on its own accord.
  1726. * Made the Cat Lord more rigourous. Technically, there should only ever be
  1727.   one Cat Lord at a time (ok, there are some ways around this, but they
  1728.   will probably be entertaining if they occur, so I'm leaving them). The
  1729.   Cat Lord should now move all cats. The latest code does prevent multiple
  1730.   Cat Lords from being cast or generated.
  1731. * Put all the code for CastFree spells in the appropriate spell files.
  1732.   Modified the spell manager to automatically amalgamate this code and
  1733.   put it in a file to be included by cast.tex.
  1734. * It is still sticking an image when a generator dies. This is wrong. I
  1735.   think it may be because we are the near the byte limitation, I am trying
  1736.   a temporary fix, soon I will change all id fields to words instead of
  1737.   chars.
  1738. * Had a brief go at doing favourite food etc., but remembered that because
  1739.   of a change to the cell scoring (in that it now does it once rather than
  1740.   for each and every creature) that it will be harder to do this than I had
  1741.   imagined.
  1742. * Completed implementation of the haunt and solar.
  1743. * Did some optimisation and tidying up of BoardUpdate.
  1744. * Implemented computer discarding for Texas trash'em.
  1745. * Stopped computer wizards from attempting Cat Lord while one on screen.
  1746. * Fixed a problem with dead graphics.
  1747. * Implemented agent casting of general magic spells.
  1748. * Completed implementation of Agathion.
  1749. * Allowed faun to cast sleep.
  1750. * Allowed azer to cast quench.
  1751. * Stopped horrors reproducing after the first time.
  1752. * Completed implementation of Dao.
  1753. * Agents now highlighted and show owner when casting.
  1754. * Completed implementation of Jann, Dao, and Marid.
  1755. * Stopped Justice, Dark Power, and Vengeance on growths.
  1756. * Allegedly fixed scoring (now tested, it looks ok).
  1757. * Changed the basic cell id to a UWORD, this gives a lot more freedom
  1758.   for making new spells.
  1759. * Tidied up some of the documentation in prog.tex and moved all the menu
  1760.   stuff to a separate file, menu.tex.
  1761. * Did a complete rebuild, it took 43 minutes.
  1762. * Moved all the magic spell handlers to the appropriate spell files.
  1763. * Changed the reincarnation table to be USHORT rather than UBYTE
  1764. * Made the spell manager write a TeX table of basic abilities. Later I
  1765.   will make other tables and convert them to PostScript.
  1766. * Turned on highlighting for Speed and Slow spells
  1767. * Turns remaining now displayed on the far right of the screen at the top.
  1768. * Turn counter stuff now works reasonably well. The game will stop when
  1769.   all turns are exhausted and the scores will be given.
  1770. * While team scores now seem correct, the don't appear correctly sorted;
  1771.   this looks like another +/- 1 type problem, that my brain just doesn't
  1772.   feel like trying to fathom at the moment.
  1773. * Added StartTiming and EndTiming to prog.tex (at the end). Didn't have
  1774.   time to test it much but hopefully it will do what you want.
  1775.  
  1776. TODO:
  1777.  - Computer use of favourite food stats
  1778.  - Elimination of reqtools
  1779.  - More production of TeX/PS tables of abilities.
  1780.  - Find exec.dis and stamps for JC
  1781.  - Power up goodies on screen
  1782.  - Complete Passage [now made prob 0 pending appropriate solution]
  1783.  - Make computer use of reincarnation more intelligent
  1784.  
  1785. - Start of changes by JJC -
  1786. * Problem: Start Chaos and Quit.  An Alert pops up (like a guru but yellow
  1787.   and non-fatal) that says "Recoverable Error: 0100 0008"
  1788.   I looked it up and that means "Damaged Semaphore".  NOW FIXED.
  1789.  
  1790. * Test a medmod with the cli medplayer program to see if it shares channels
  1791.   or not.  IT DOESN'T.
  1792.  
  1793. * Edited descriptions of Marid,Rat.
  1794.  
  1795. * Fixed up Timing Code.
  1796.  
  1797. * After an hour of getting bizarre results I have reached the conclusion
  1798.   that the SASC Timer function does NOT have microsecond resolution.
  1799.   Instead it has 1/60th second resolution and it then adds +/- 1 to 3
  1800.   microseconds onto that result.
  1801.  
  1802. * Implemented asm TestPixel.
  1803.   Time to Test 32 rows of 320 pixels on a 5 bpl lores screen on 25Mhz 030
  1804.   ReadPixel 500009us
  1805.   TestPixel 100002us
  1806.  
  1807.   So TestPixel is about 5x as fast as ReadPixel.
  1808.  
  1809.   
  1810. * When simulacrumming an unanimated creature with double in effect it is not
  1811.   drawn immediately. In fact it isn't drawn till something triggers
  1812.   ReDrawAll=YES.  NOW FIXED.
  1813.  
  1814. Subversion appears broken.  Player 1 subverted a White Dragon and it made the
  1815. success sound but didn't make it mine.  Player 2 just subverted a different
  1816. White Dragon and it made the success sound and it DID make it mine... hmm..
  1817. The only thing I can figure is that the spell works perfectly and I just
  1818. mistook the sound effect.
  1819.  
  1820. * I noticed that Reflector always did exactly 3 points of damage to the
  1821.   shooter rather than actually "reflecting" the damage back to the shooter.
  1822.   e.g. A White Dragon shot me and it should have "reflected" 9 points of
  1823.   damage back to him but instead only did 3.
  1824.   Also, if the wizard had a 15 Ranged Combat Rating then even a Camel would
  1825.   get hit with 15 points of retaliatory damage.
  1826.   Also, if an Undead Shooter shoots an ordinary Reflectified Wizard then
  1827.   the damage does NOT reflect onto the shooter; instead it is an "invalid
  1828.   attack, cannot attack undead"
  1829.  
  1830.   So in fact either the spell should be renamed to "Retaliation" or
  1831.   "Retaliatory Strike" or the Reflector Spell Code should be reworked to
  1832.   actually "reflect" the incoming damage.
  1833.  
  1834.   I chose to rework the code so now the exact damage is always reflected
  1835.   onto the shooter.  Even the exact _type_ of damage is reflected:
  1836.   Intelligence damage is reflected as Intelligence damage. Ditto for
  1837.   poisoning and all the other stats.
  1838.  
  1839. I cast Reincarnation on my Manticore which my wizard was riding at the time
  1840. but when they killed my Manticore it didn't reincarnate into a Centaur!  It
  1841. just died and disapeared like usual! 8(
  1842.  
  1843. * Implemented linearly equidistant ascending order bitplanes.  Works fine.
  1844.   From now on all custom gfx routines can gain an extra 15% or more speed
  1845.   due to this fact.
  1846.  
  1847. * Rewrote TestPixel to take advantage of the equally spaced bitmaps but the
  1848.   timer is so lores that it doesn't show any speed increase. 8(
  1849.   It should be about 6x faster than ReadPixel now.
  1850.   Perhaps if I do a smake release then try timing it then I can get more
  1851.   accurate results.
  1852.  
  1853. * Upon noticing that the isLineOfSightTest really does only check the first
  1854.   4 bitplanes I changed TestPixel to work the same way and made another
  1855.   optimization as well. Saved about 20 cycles.  But I don't understand why
  1856.   it was only checking 4 bitplanes??  That means that all colors from 16 to
  1857.   31 are all "transparent" and don't block line of sight.  Do any game
  1858.   objects currently use colors 16 to 31???
  1859.   - SAI: No this code IS correct. Colours 16 to 31 are used and do block
  1860.     LOS.
  1861.   - JJC: Ok it all makes sense to me now.
  1862.  
  1863. * Once I looked at isLineOfSightTest I realized that I somehow COMPLETELY
  1864.   missed this routine before!  I just greatly optimized it.  It should be
  1865.   about 2x to 3x as fast as before.
  1866.  
  1867. * OK NOW AT LONG LAST, COMPUTER TREE-CASTING SHOULD BE ABOUT 3x as fast as
  1868.   before!!!!!!
  1869.  
  1870. * btw: You can verify that ReadPixel and TestPixel are in agreement by
  1871.   pressing the a key.  The b key measures the speed of ReadPixel and the
  1872.   c key measures the speed of TestPixel.
  1873.  
  1874.  
  1875.  
  1876. *** SPLIT SCREEN TECHNOLOGY UPGRADE ****************
  1877. Right now the WriteNearBottom text can go all the way to the edge and beyond
  1878. beyond so a hi-res screen will keep it from going off the edge.
  1879.  
  1880. * Implemented Split-Screen Technology.  Or in the present form it might be
  1881.   better referred to as Dual-Screen Technology.
  1882.  
  1883. I've wanted to do this since December 1996.  Well, actually I've wanted to
  1884. make a split-screen game since September 1985 when I first saw the Amiga's
  1885. HiRes mode.  Using dual screens allows the presentation of HiRes
  1886. sharp-looking text while also allowing the use of really cool finely
  1887. textured 64 color graphics on the A500.
  1888.  
  1889. I've seen so many games over the years that could have greatly benefitted
  1890. from using a split screen.  Every time I see a game that doesn't use one I
  1891. want to go into the program and MAKE it use one.  EVERY Amiga ever made
  1892. (even the original 1985 A1000) supports 640x200 resolution so there is
  1893. simply NO EXCUSE not to use it!  I want a game that makes use of my
  1894. computer's capabilities.
  1895.  
  1896. I don't mind large fonts, its just that I do mind _blocky_ fonts.  320x200
  1897. text just doesn't cut it for me.
  1898.  
  1899. * Changed WriteBottom and WriteNearBottom to work with the new system.
  1900.  
  1901. * I had to change the WriteBottom statement in braindrain.spl and nuke.spl
  1902.   to keep it coordinated.
  1903.  
  1904. * New function PutScreen which is easier to work with than MoveScreen.
  1905.  
  1906. * I am trying to keep the HiRes screen down to only 8 colors so I had to
  1907.   eliminate 3 colors from the CreatureInfo screen. 16 color HIRES is
  1908.   extremely slow.
  1909.   Color list from info.tex:
  1910.   GREEN1
  1911.   GREEN2
  1912.   BLUE1
  1913.   PINK
  1914.   RED3
  1915.   YELLOW
  1916.   CYAN
  1917.   BLACK
  1918.  
  1919.   WHITE  replaced with CYAN
  1920.   BROWN  replaced with PINK
  1921.   ORANGE replaced with BLUE1
  1922. * Translated the above pallete onto the HiResScreen.
  1923.  
  1924. * Translated SpellInfo Screens onto the HiResScreen.
  1925. * Translated Creature Info Screens onto the HiResScreen.
  1926. * Translated Game Loading/Saving onto the HiResScreen.
  1927.  
  1928. Now we just have to decide what we are going to do with all that extra
  1929. space.  Do we use bigger fonts?  Do we combine the 1st and 2nd screens
  1930. together?  ???
  1931.  
  1932. ***** END OF SPLIT SCREEN TECHNOLOGY UPGRADE *****
  1933.  
  1934.  
  1935. >* Subversion of a sleeping creature did not clear Sleeping Stat;
  1936. >  although the owner was correctly changed.
  1937.   Ok, I didn't realize that Subversion was supposed to wake creautures up.
  1938.   Now it does.
  1939.  
  1940. >* When a cloaked creature goes to sleep the cloak image disappears;
  1941. >  although the creature keeps the cloaked stat. That in itself is not a
  1942. >  problem; however, once woken the cloak image does not return.
  1943.  
  1944. Ok, I fixed it so a sleeping cloaked creature who is awakened will show up
  1945. graphically as a cloaked creature. Not tested due to problems with
  1946. makefile not rebuilding castmagic.c.
  1947.  
  1948.  * The sequence Cloak->Sleep->Wake produces a cloaked creature on
  1949.    your side, but although info fails on it, the animated graphic
  1950.    is visible!  This should now be fixed but someone needs to test it to be
  1951.    sure.
  1952.  
  1953.  
  1954. I haven't decided what to do about putting a cloaked creature to sleep.
  1955. How do you want that handled?  Do you want it to still appear graphically
  1956. cloaked or ?
  1957.  --SAI: Visible, one could assume that maintaining a clock requires effort
  1958.    therefore a sleeping creature doesn't maintain it.
  1959.  
  1960.  
  1961. >* Agents (Dao, Marid, etc.) look at the wrong player when testing for a
  1962. >   double or triple effect. I suspect this is another off by one effect.
  1963. >  (Should be easy to find this problem in AgentCast).
  1964.   JC is not attempting to fix this one due to never knowing whether to use
  1965.   Array[x] or Array[x-1] or Array[x+1].  Leaving this for SAI.
  1966.   --SAI NOW FIXED
  1967.  
  1968. BUG: smake newspell doesn't rebuild the file castmagic.c from the
  1969. individual .spl files.  It just ignores the new .spl files and uses the
  1970. same old castmagic.c file as before.
  1971. btw: I deleted castmagic.c and then did smake newspell but that didn't work
  1972. either.  It still didn't rebuild castmagic.c 
  1973.  
  1974. * I added the line "execute spellmanager" to the newspell: part of the
  1975.   lmkfile.  Hopefully that fixes everything relating to castmagic.c
  1976.  
  1977. * Fixed all warnings related to warp.tex
  1978.  
  1979. * BUG: Closing the FileRequester or selecting CANCEL does not actually
  1980.   cancel anything.  The game still loads/saves the game.  NOW FIXED.
  1981.  
  1982. * PROBLEM: Whenever the game stops the animation system for a legitimate
  1983.   reason the sprite also stops.  This results in jerky sprite animation
  1984.   on all Amigas.  On the A500 this is especially noticeable since the
  1985.   sprite spends most of its time in slow motion and jerking arouind in an
  1986.   icky manner.
  1987.   SOLUTION: I have Implemented the sprite animation as a vertical blank
  1988.   interrupt so it will ALWAYS be animated smoothly, regardless of
  1989.   ObtainSemaphore() or Forbid(). This makes playing the game on the A500 a
  1990.   zillion times better.  This should also allow the sprite to keep up with
  1991.   moving creatures better.
  1992.  
  1993. * I tried to implement the color cycling into the vblank interrupt but that
  1994.   just didn't work.  It turns out that beyond v36, LoadRGB4 and SetRGB4
  1995.   cannot be legally called from interrupts.
  1996.  
  1997. * Implemented new ChaosColorCycler Task which is responsible for all color
  1998.   cycling.  This allows color cycling to continue unabated even when the
  1999.   CHAOSANIM Task is prevented from running by an ObtainSemaphore.
  2000.  
  2001. * Implemented new method for seeing which stats are attacked by Combat,
  2002.   Ranged Combat and Special Combat.  Just click on Combat and the stats
  2003.   that it attacks will begin flashing. The old method was just never clear
  2004.   enough for me.  Hopefully this new method will make things more clear.
  2005.  
  2006. * Eliminated that 1 pixel of empty space from the top of the screen since
  2007.   screen real estate is at a premium.
  2008.  
  2009. * r=Range; s=Shoot; m=Move;
  2010.  
  2011. * Pressing the "r" key now shows the shooting range of the current
  2012.   creature by highlighting the cells that can be shot. Looks kewl!
  2013.   
  2014. * Pressing the "s" key now shows the cells that the current creature
  2015.   can shoot into (taking into account any LineOfSight requirements).
  2016.  
  2017. * Pressing the "m" key now shows the cells that the current creature can
  2018.   move into.
  2019.  
  2020. * BONUS: the new "r" and "s" and "m" routines use the asm SqDistance and
  2021.   TestPixel routines to provide superfast response!
  2022.  
  2023. * FLAW: computer controlled creatures can't shoot quite as far as human
  2024.   controlled creatures due to the fact that humans are given an extra .5 on
  2025.   their range while computer players are not.  I have now rewritten the
  2026.   range code such that all shooting ranges are calculated identically for
  2027.   humans, computers and the "r" and "s" keys.  NOW FIXED.
  2028.  
  2029. * When a creature is about to shoot, its actual .Range stat is printed at
  2030.   the bottom of the screen.
  2031.  
  2032. * PROBLEM: When deciding which spell to cast, the really cool
  2033.   auto-mouse-reporting feature that tells you what thing is under your
  2034.   mouse pointer is deactivated.  I've been wanting to keep this active
  2035.   during spell selection forever.  Now I finally did it!  YAY!
  2036.  
  2037. * The "r" and "s" and "m" keys now work on whatever cell the mousepointer
  2038.   is over at the time of the keypress!!! (Assuming there is no creature
  2039.   currently highlighted.)  YAHOO!  Now we can easily inspect the ranges and
  2040.   movement capabilities of any creature!!!!
  2041.  
  2042. * Now if you press SHIFT+r or SHIFT+s or SHIFT+m it displays the range info
  2043.   for the creature under the mousepointer _even_ if you have already
  2044.   clicked on a creature and that creature is highlighted by the sprite.
  2045.   This allows you to go around graphically inspecting the ranges of
  2046.   creatures right in the middle of moving one of your monsters!! Kewl!
  2047.  
  2048. * Put in some more code to support retargetable graphics.
  2049.  
  2050. * Implemented the new Highlighting method on Creations + Allies with
  2051.   numeric keys.
  2052.  
  2053. * Partially optimized HandleMOUSEMOVE();
  2054.  
  2055.   FLAW: The Hide spell is listed as a BONUS spell yet I keep getting them
  2056.   in my startup spell list. I frequently start a game with 2 of these
  2057.   spells showing.  I'm leaving this for SAI to fix as I don't know anything
  2058.   about the spell probability system.
  2059.  
  2060.  
  2061. Nov. 6th: sent complete archive to SAI so he can decide if he wants to make
  2062. a new version of the Chaos.font that is either 8 tall x 16 wide or 12x12 or
  2063. 8 tall x 12 wide; thus allowing the font to be smoother, larger and
  2064. (hopefully) easier to read.
  2065.  
  2066. --- Changes made by SAI ---
  2067.  
  2068. * Fixed the bug pertaining to the Dao, Marid etc.
  2069.  
  2070. My monitor is being a real pain on a day when I was hoping to fix lots of
  2071. little things. It worked for long enough to be impressed with the s, r,
  2072. m keys new info panels etc. I like them all. Now switching to my old 11"
  2073. monochrome screen.
  2074.  
  2075. * Implemented flying pointer.
  2076. * Fixed Invert slowness.
  2077. * Fixed Hide spell showing up on spell lists inappropriately
  2078.   (actually caused by Passage having rank 0 and prob 100)
  2079. * Gave Marid and Dao to more sensible probabilities.
  2080. * Added Edit option to first menu. It is just a stub at the moment
  2081.   so that I can work on it while you work on the main game.
  2082. * Added code to support a classic option
  2083.     - New global variable "classic"
  2084.     - New gadget on second SetUp screen to select mode
  2085.     - Changed io.tex to save "classic"
  2086.     - Change program to reload spell probs for each new game
  2087.     - Change Spell Manager to produce both chaos.prb and classic.prb
  2088.  
  2089. So far Faun is the only classic creature! I need to update the spell
  2090. files to show which are classic. NOW DONE.
  2091.  
  2092. * Fixed quickshot imagery
  2093. * Allowed reincarnation of creature even when mounted.
  2094.  
  2095. * Added new spells: Abath, Abduction, Acid Rain, Amphisbaena, Archery, Betrayal,
  2096.   Thundermare, Iridium Horse, Chaos Lord, Devastation, Disection, Hidden Horror,
  2097.   Mana Battery, Meddle, Necropotence, Points, Bipedal Generator.
  2098.  
  2099. I was amazed at how easy adding new spells is now. No more having to worry
  2100. about making sure I added all the appropriate pieces of information. All you
  2101. have to do is bang together a new spell file and change a couple of other
  2102. things. Once upon a time it would have taken a week to add this many new spells.
  2103. I've done it in four hours (I must admit I haven't tested them yet) and I
  2104. didn't yet complete the implementation of Necropotence. The new general combat
  2105. system is really cool for adding stuff as well.
  2106.  
  2107. JC you might want to check the descriptions of these new spells the are bound
  2108. to need tweaking. I haven't ad time to proof read them properly.
  2109.  
  2110. * Implemented the secret powerup Horse->Thundermare->Iridium.
  2111.  
  2112. * There was a bug in UpdateBoard that is not looking after wizard stats properly,
  2113.   I discovered this after implementing the ChaosLord spell.
  2114.  
  2115. * Moved powerup display hard left on info screen. I now think this might better
  2116. go on the line under the name line. Needed to move it left because some wizards
  2117. ad so much stuff it was going off the right of the screen. Also had to move it
  2118. up slightly.
  2119.  
  2120. * Set the Classic flag for all the appropriate spells. Also changed the game
  2121.   to start in "classic" mode by default.
  2122.  
  2123. * Allegedly fixed a problem that was causing the game to hang on Quit.
  2124.  
  2125. * Modified the I/O routines to save the entire probability table with a saved
  2126.   game. NOW TESTED, all seems to work.
  2127.  
  2128. * Added tex2c.c to archive. Actually this is a tool I have used on lots
  2129.   of projects and originally I had visions of making it a farily powerful
  2130.   thing, but that never eventuated.
  2131.  
  2132. Doing one last rebuild to test and then sending archive.
  2133.  
  2134. SAI -- ReleaseS
  2135. JJC -- ObtainS   Begin Version 2.0
  2136.  
  2137. * Played 1 small test game to get a Thundermare and an Iridium Horse.
  2138.   Awesome!
  2139.  
  2140. * Made minor changes to most of the new spell descriptions: Abath, Abduction,
  2141.   Acid Rain, Amphisbaena, Archery, Betrayal, Thundermare, Iridium Horse,
  2142.   Chaos Lord, Devastation, Disection, Hidden Horror, Mana Battery, Meddle,
  2143.   Necropotence, Points, Bipedal Generator.
  2144.  
  2145. Are independent creatures really attracted toward Mana Batteries?
  2146.  
  2147. My fave new spells are ThunderMare, Iridium Horse, Chaos Lord and Archery
  2148. (hey you stole my spell!).  I rather liked many of the new spell
  2149. descriptions; one or 2 of them made me crack up laughing and most were just
  2150. plain interesting to read.
  2151.  
  2152. * 1 bug in DoComputerCast removed.
  2153.  
  2154. * I could find no evidence in the casting code of Depth removing LOS
  2155.   requirements so I changed the description of Depth accordingly.
  2156.  
  2157. * For humans, Depth only worked on spells > ImpID yet for computer wizards
  2158.   Depth just plain worked for everything. I adjusted it to be >ImpID for
  2159.   everyone.
  2160.  
  2161. * DoComputerCast never checks the CAST_GROWTH bit.  This explains why they
  2162.   cast weird spells on growths.  They were cheating!
  2163.  
  2164. * DoComputerCast never checks for the presence of an Arborist spell.  Poor
  2165.   guys.  They could NEVER put 2 trees next to each other.
  2166.  
  2167. * That's a total of 4 discrepancies between DoCast and DoComputerCast.  I
  2168.   fixed all this by writing a new "Grand Unified Spellcasting Rules Function"
  2169.   that DoCast and DoComputerCast and the "c" key all use to determine if a
  2170.   postulated cell/spell/wizard combination would be legal or not.  This
  2171.   should help to eliminate lots of bugs in the future.  From now on, all
  2172.   spellcasting rules just go one place ObeySpellCastingRules.  This ensures
  2173.   that both computer wizards and human wizards and agents all follow the
  2174.   exact same set of rules.
  2175.  
  2176. I noticed this line in the cast.tex:
  2177. HighLightCell = (WORD)cell; /* first to give some time to catch up */
  2178.  
  2179. btw if you ever want to make _sure_ that the sprite has caught up then you
  2180. can just do a WaitVblank(1);
  2181.  
  2182. I've never done that because I didn't want to slow down the game with a
  2183. bunch of Waits.  And anyway now that I redid the sprite animation as a
  2184. vblank interrupt it is now IMPOSSIBLE for an ObtainSemaphore to stop the
  2185. sprite from being redrawn at the correct position for long periods of time.
  2186. So the maximum length of time to catch up is 1/50th of a second.
  2187.  
  2188. * c = casting.  During the spellcasting phase you can press c and all the
  2189.   legal targets for your spell are highlighted in the color cycling color.
  2190.   This can be useful in the regular game as well as for testing the
  2191.   spellcasting rules.
  2192.  
  2193. * q = query = question mark to bring up info screens.
  2194.  
  2195. Hey this is sort of cool, driving around the screen with the mouse in one
  2196. hand and the keyboard in the other.  It is now very quick and easy to zip
  2197. around with the mouse and press q to see the info screens.  q,s,r and c are
  2198. all on the left hand side of the keyboard.  Only m is on the right hand
  2199. side, so your left hand can sit on the keyboard and your right hand on the
  2200. mouse.  Maybe we should have a=m=move because a is on the left hand side of
  2201. the keyboard... but a should really be attack so I dunno...
  2202.  
  2203. * Added new subsection to the docs {Keys}  Plus other small improvements.
  2204.  
  2205. *********************************************************************
  2206. Mini Level Editor Upgrade:
  2207. * ALT + d = Delete
  2208. * ALT + c = Copy
  2209. * ALT + p = Paste
  2210. * ALT + o = Object (This lets you pick any object from the game and place
  2211.                     it anywhere you like!)
  2212.   This works with a hierarchical menu system which allows you to find
  2213.   the creature you are looking for according to how you think of it.
  2214.  
  2215.   Click the Orc to get a list of all ground creatures.
  2216.   Click the dead Orc to get a list of all dead ground creatures.
  2217.   Click the Orc scroll to get a list of all ground creature scrolls.
  2218.   Click the Skeleton to get a list of all undead ground creatures.
  2219.   Click the Skeleton Scroll to get a list all undead ground creature scrolls.
  2220.  
  2221.   Click the Harpy to get a list of all flying creatures.
  2222.   Click the dead Harpy to get a list all dead flying creatures.
  2223.   Click the Harpy Scroll to get a list all all flying creature scrolls.
  2224.  
  2225.   Click the Ghost to get a list of all Undead Flying creatures.
  2226.   Click the Ghost Scroll for a list of all Undead Flying creature Scrolls.
  2227.  
  2228.   Click the Wall for a list of all inanimate objects.
  2229.   Click the Wall Scroll for a list of all inanimate object scrolls.
  2230.  
  2231.   Click the GooeyBlob for a list of all Growths.
  2232.   Click the GooeyBlob Scroll for a list of all Growth Scrolls.
  2233.  
  2234.   Click the Horse for a list all Mounts and Meditations.
  2235.   Click the Horse Scroll for a list all Mounts and Meditations Scrolls.
  2236.  
  2237.   Click the Green Dragon for a list of all Level2 Mounts.
  2238.   Click the Green Dragon Scroll for a list of all Level2 Mount Scrolls.
  2239.  
  2240.   Click the Wood Elf for a list of all Archers.
  2241.   Click the Wood Elf Scroll for a list of all Archer Scrolls.
  2242.  
  2243.   Click the Bolter Wall for a list of all things that can shoot.
  2244.   Click the Bolter Wall Scroll for a list of Scrolls for things that can shoot.
  2245.  
  2246.   Click on the Armour for a list of all Magic Spells. ( > ExitID)
  2247.  
  2248.   After you click on the actual object that you want then just click on the
  2249.   board where you want it and *poof* it will appear there.  It will also be
  2250.   in your copybuffer so you can paste successive copies with ALT + p.
  2251.  
  2252. These keys require ALT for now so that people who aren't supposed to know
  2253. about them won't.  Unfortunately, having to press 2 keys to do something is
  2254. not user friendly so we either need "Edit Mode" or gadgets that do the same
  2255. things as these keys.
  2256. These are very simple and don't have any special code for handling wizards
  2257. or the lists associated with list agents.  Nevertheless it is possible to
  2258. edit levels with these commands.  And since they are all #ifdef'ed they
  2259. take up about 0 bytes in the smake release.
  2260.  
  2261. * Lots of new predicates all #defined in predicate.tex which work with
  2262.   object ID's instead of cells.
  2263.   All new predicates are thus far used only in the level editor code:
  2264.   isIDinanimate(id)
  2265.   isIDgrowth(id)
  2266.   isIDundead(id)
  2267.   isIDflying(id)
  2268.   isIDmount (id)
  2269.   isIDdragon(id)
  2270.   isIDarcher(id)
  2271.   isIDshooter(id)
  2272.  
  2273. **********************************************************************
  2274.  
  2275.  
  2276. Azers don't heal even though they have a 2 recovery rate.  I see you have
  2277. rewritten the recovery code so I'll just leave this for you to fix.
  2278.  
  2279. * Added the bar graphs of the recovery rates to the information panel.
  2280.  
  2281. * Columnarized the stats on the 2nd info screen so SAI will have room to
  2282.   implement his "Creatures Killed" stuff. In my notes I called it
  2283.   "Foes Vanquished"
  2284.  
  2285. * Weird graphic glitch:  Clicking on the word combat causes a rectangular
  2286.   black spot at the top of the screen where the title bar is supposed to be.
  2287.   This partially overwrites the powerup icons.
  2288.   I have determined that anytime you click the mouse into a window which is
  2289.   not currently active that the lores screen gets this black spot but ONLY
  2290.   when there is a nonbackdrop window in that area.  The NewGame window has the
  2291.   same problem when you click the mouse into the bottom of the screen (the
  2292.   hires screen).  Do you know of some way to disable the OS from redrawing the
  2293.   TitleBar every time the user clicks a new window?
  2294.  
  2295.   Are you getting this same glitch on your OS?
  2296.  
  2297.   The only way I know to eliminate this problem is to just ALWAYS use the
  2298.   backdrop window for everything. This is something I have been planning to
  2299.   do for a long time anyway to save chipram.
  2300.  
  2301.   As a quick and reliable fix (only works on the info screen) I have simply
  2302.   activated the hires screen FIRST before anything gets drawn.
  2303.   I also had to remove the autoACTIVATE bit from the newwindow structure.
  2304.   This way when the user Clicks on Combat he isn't changing windows so the
  2305.   titlebar doesn't get redrawn.
  2306.  
  2307. * Fixed that annoying problem where an independent creature could move next
  2308.   to one of your creatures and attack it while the highlight sprite didn't
  2309.   bother to highlight the creature in its new cell until AFTER the attack
  2310.   was complete and even then it was instantly turned off.  This was caused
  2311.   by the complete lack of HighLighting code in cMoveNonEngaged.  NOW FIXED.
  2312.   The sprite now appears to keep up much better.
  2313.  
  2314. * BUG: SpellInformation(); on a WebAID, WebBID, WebCID, WebDID, VWallID,
  2315. HWallID, ExitID causes the game to NOT print the spell description for that
  2316. spell and it crashes the computer.  I don't know how the compressed pooled
  2317. descriptions work or how HIDDEN spells are supposed to work so I just leave
  2318. this for you to fix. NOW FIXED
  2319.  
  2320. BUG: I have a bat with 0 life and -4 recovery but it isn't dying.
  2321. SAI: I failed to replicate this problems. I had an azer in the same situation
  2322. and it did die.
  2323.  
  2324. * BUG: The computer seems to think that player 2 and DEADP are on the same
  2325.   team. It looked very strange when I pressed "2" and all the dead things
  2326.   on the screen lit up in BLUE.  NOW FIXED.
  2327.  
  2328. * YIPERS!  Team[] was only big enough for the 8 players plus asleep.
  2329.   Accessing Team[DEADP] was a bad subscript error.  NOW FIXED.
  2330.  
  2331. * FLAW: ChaosLord did not set the FLYING_STAT bit of the wizard. NOW FIXED.
  2332.  
  2333. * Replaced 3 old slow codes in init.tex with faster GetCell(x,y).
  2334.  
  2335.  
  2336. **************************************************
  2337. ********** MAJOR NEW GAMEPLAY MECHANIC ***********
  2338. **********          SCROLLS            ***********
  2339. **************************************************
  2340.  
  2341. Read the docs for a complete explanation of scrolls.
  2342.  
  2343. Scrolls add the following Play-Mechanics to the game:
  2344.  
  2345. 1) The "Collect Things" Play-Mechanic.
  2346.    Sometimes it is just plain fun to collect things and add them to your
  2347.    colletion. This applies to both games and real life.
  2348.  
  2349. 2) The "Limited Resources so you better get moving and grab them while you
  2350.    can!" Play-Mechanic.
  2351.  
  2352. 3) To some extent it adds the "Colonization" Play-Mechanic because you want
  2353.    to hurry up and grab as many scrolls as you can early in the game
  2354.    rather than just sitting in a tree meditating.
  2355.  
  2356.    I have played many games where I initially hopped into a meditation and
  2357.    then just cast powerups on myself to avoid confrontation.  In the exact
  2358.    same situation with Scrolls added I would have to rethink my strategy.
  2359.    I might make a mad dash for an important spell and get drawn into a
  2360.    fierce battle as a result.
  2361.  
  2362. btw: Scrolls make being player 7 or 8 more advantageous.
  2363.  
  2364. All in all Scrolls make a powerful additional option for an already superb
  2365. game.  There are now some intriguing new ways to play the game.  Like start
  2366. with 0 or 1 spells but 99 Scrolls with you against 3 enemy wizards and 1
  2367. generator.  It makes the game take on a whole new flavor.
  2368.  
  2369. BTW: If we don't get the level editor fully functional for a while now it
  2370. is no big deal.  You can just play the game with 99 Scrolls and between
  2371. those 99 spells + the 20 in your spell list you'll probably have the spells
  2372. you want to test available to you.
  2373.  
  2374.  
  2375. * There was something in the code whereby if you were obtaining a new
  2376.   spell but your SpellTable up to the number of Spells you started with
  2377.   was full then you didn't get your spell.  I changed this by replacing
  2378.   "Spells" with "MAX_SPELLS" in AddGUISpell so that way if you start the
  2379.   game with 10 spells and cast 2 of them and then get 8 new spells you now
  2380.   REALLY get them instead of most of them being "lost".  I also changed
  2381.   SpellTable to hold up to 150 spells instead of just 100.  Even
  2382.   though the largest number of spells that you can _start_out_with_ is 99.
  2383.  
  2384. * New Predicate isScroll(cell)
  2385. * New Function InsertScroll(cell)
  2386. * New Function InsertCorpse(cell)
  2387.  
  2388. **** Bug report + Fix *********************************************
  2389.  
  2390. * I was having a serious bug where scrolls with an ID > RevealID were being
  2391.   inserted into cells.  This caused enforcer hits and lots of crashes.
  2392.  
  2393.   Here was the guilty code:
  2394.        if (z==0) z=(MSGRandom() % (ExitID-1))+1;
  2395.        else
  2396.        z=(MSGRandom() % (RevealID-ExitID)) + ExitID+1;
  2397.  
  2398. It took me a while to figure this out... I looked at it several times and
  2399. my math seem to be ok yet IDs greater than RevealID were being generated
  2400. by this code.
  2401.  
  2402. The problem turned out to be that RevealID is not a simple number but a
  2403. "complex constant".  It is a large mathematical expression, actually.
  2404.  
  2405. RevealID works out to CloakID + 1
  2406. CloakID  works out to BuryID + 1
  2407. BuryID   is MagicSheildID + 1
  2408. MagicShieldID is OrcsID + 1
  2409. ad nauseum
  2410.  
  2411. Rule: NEVER USE IDs in anything but simple expressions without
  2412.       enclosing each ID in parenthesis.
  2413. This is one of the drawbacks to using #defined expressions instead of
  2414. variables.
  2415.  
  2416. FIXED BY: Enclosing RevealID and ExitID in parenthesis. (RevealID) (ExitID)
  2417.  
  2418. Maybe we should enclose all #defines in parenthesis in their definition?
  2419. SAI: The best solution would be to replace all the #defines by an
  2420. enumeration. It would probably lead to faster compilation. However, since
  2421. the Spell Manager now depends on the #define list several modifications
  2422. would be necessary.
  2423. JC: I think if we just enclose each #define in () that will suffice.
  2424. **** End Bug Report + Fix *********************************************
  2425.  
  2426.  
  2427. ***************************************************
  2428. *********     END OF SCROLLS UPGRADE    ***********
  2429. ***************************************************
  2430.  
  2431. Played a test game and teams work fine for the number keys but for
  2432. spellcasting they are totally screwed up.  All the computer wizards were
  2433. casting spells on computer wizards who were not on their team and on human
  2434. wizards who were not on their team.  I sure hope SAI can figure this out. NOW FIXED
  2435.  
  2436. ----
  2437. ObtainS by SAI
  2438.  
  2439. Survived potential heart-attack seeing the archive named "encryptedchaos".
  2440. I have always (well not always, but for a long time) wanted something like
  2441. scrolls. Full points for actually having the guts to implement it. I can't
  2442. wait for it to compile so I can try it! I will also investigate your edit
  2443. functions and then try and amalgamate the two editing systems.
  2444.  
  2445. Have noted the above unsolved bug reports and will attempt to resolve them.
  2446.  
  2447. BUG: Press ALT-o part way through a previous ALT-o and I couldn't get
  2448. back to the game.
  2449.  
  2450. * BUG: Program lets you select growths to move. NOW FIXED.
  2451.  
  2452. BUG: New game followed by quit (sometimes) fails to terminate. I think this
  2453.   occurs because if ObtainSemaphore has been done the Animator tasks fails
  2454.   to terminate as expected. This suggests there is something wrong with how
  2455.   the menu system is using ObtainSemaphore, but I have been unable to trace
  2456.   this fault.
  2457.  
  2458. * Fixed MassMorph to not destroy bipedal generators.
  2459. * Made independent attract to Mana Battery.
  2460. * Fixed problem of info of spells without description.
  2461. * Made minor changes to game docs.
  2462. * Made a slight change to the testing of spells during scroll insertion.
  2463.  
  2464. * Identified the cause of the Team bug. It is a simple problem with the
  2465.   spell manager writing assist.h.
  2466.  
  2467. * Added my editor into the source code, will try to amalgamate with JC
  2468.   mini-editor code. Suggestion: to make it harder to accidently discover
  2469.   ALT-o etc. suggest the user have to type ALT-! before these special
  2470.   key-presses will work.
  2471.  
  2472.   JC: I'm not even sure we should have those keypresses in the game at all.
  2473.   I just DEFINITELY wanted something that I could use quickly to test things
  2474.   with right then at that moment.
  2475.   I just threw all that code together in 1 day because it just hit
  2476.   me how I wanted to do it.  It is a miracle that it worked.  After I sent
  2477.   you the archive I tested the editing stuff and was quite pleased that it
  2478.   actually worked!!
  2479.  
  2480. * Started implementation of foes vanquished. Discovered this would mean
  2481.   lots of changes to move.tex. To ensure I make these changes properly
  2482.   I'm going to careful go through printouts of this module and also
  2483.   cmove.tex. Some spell handler may also need to be changed, but I will
  2484.   ignore that temporarily.
  2485.  
  2486. SUGGESTION: Have an option for scrolls where you cannot see in advance
  2487. what you scroll will be.
  2488.  
  2489. * Added Wizards variant of wizards and made changes in move.tex. This saved
  2490.   28K.
  2491.  
  2492. * Modified editor to work with scrolls.
  2493.  
  2494. * Made minor modifications to InsertScroll.
  2495.  
  2496. * Put some common cell manipulation routines in a new module core.tex.
  2497.   Reinstate, Insert*, PutToSleep, ClearUnder, WakeUp.
  2498.  
  2499. * Moved WizardExplode effect into cell.tex.
  2500.  
  2501. * Added an isGenerator predicate.
  2502.  
  2503. * Added scrolls docs to user docs. Didn't do it very well however.
  2504.  
  2505. * Combined the JC mini-editor commands (except ALT-o) with my editor.
  2506.   x is a synonym for d, v is a synonym for p. The the three keys
  2507.   "XCV" now do cut, copy, paste as is typical in many applications.
  2508.   In the mini-editor ALT must be pressed, in the general editor ALT
  2509.   is unnecessary. These key presses still have major flaws when applied
  2510.   to wizards, but they are a good start.
  2511.  
  2512. * Modified InsertCorpse to insert a nothing when passed an argument not
  2513.   having a dead image. This makes sense, and is now necessary since 
  2514.   InsertCorpse is now called from several places.
  2515.  
  2516. * BUG: I have now comfirmed that TestPixel does not seem to work properly
  2517. in Spunge. I replaced TestPixel with ReadPixel and the problem went away.
  2518. Earlier explanation: The graphic effect used with Dark Power no longer seems to work properly
  2519. only works for the lowest 4 bits of each cell. NOW FIXED
  2520.  
  2521. * Fixed Abduction and Raise Dead (for some reason Raise Dead was leaving the
  2522.   corpse underneath). Actually I think that means the corpse was already
  2523.   there which means there is something else wrong as well.
  2524.  
  2525. * Vanquished foes now working including saving of this information. However, I
  2526.   am not at all convinced that memory is been released properly in all cases
  2527.   when an object dies, e.g. when a creature falls in a pit. Also when a spell
  2528.   like Replicate is used, this replicates the vanquished list for that creature
  2529.   as well (not quite, both creatures end up using the same list--since this is
  2530.   rather neat I haven't changed it).
  2531.  
  2532. * Implemented a bomb explosion effect. It is now used for Nuke and the Goblin
  2533.   Bomb.
  2534.  
  2535. * Fixed the recovery rate code. I did however notice a python that refused to
  2536.   died (this may be related to the pox or maybe it had been powered up in some
  2537.   way, I'm not worrying about it unless I see it again).
  2538.  
  2539. * Removed another bug from io.tex (a bad bug).
  2540.  
  2541. QUERY: Should scrolls be generated according to their probabilities.
  2542. Current all spells are equally likely under scrolls and hence powerful
  2543. spells are relatively common. I'm not saying this is bad, but is it
  2544. what you intended?
  2545.  
  2546. Well, it is what I intended for the moment.  I just wanted to try something
  2547. different.  Since I had only played the game with 2 sets of probabilities
  2548. (regular and classic) I thought I'd try yet another set of probabilities
  2549. just to see how it worked out.  I played some test games and it seemed ok
  2550. the way it is as long as you play with a small number of scrolls, say
  2551. 20 or less.  But with 99 scrolls there are multiple Touch of God and
  2552. Iridium Horse scrolls laying around which I didn't think was the best
  2553. thing, however I have a nifty fix for this which I will hopefully implement
  2554. this week.  Then we can playtest it some more and make a final decision
  2555. on the scroll-probability system later.  I have many things to do with
  2556. the scrolls concept this week.
  2557.  
  2558. --- End SAI changes ---
  2559.  
  2560. --- JJC ObtainSemaphore ---  Begin Version 2.1
  2561.  
  2562. ************** BEGIN tex2c speed upgrade ****************
  2563.  
  2564. * Installed new tex2c.c into the archive.  Be sure to compile it
  2565.   according to the instructions contained in the source.
  2566.   Or hopefully I'll just Email it to you if I can.
  2567.   Be sure to replace the old version with the new one in your command
  2568.   path or you won't benefit from the speed increase.
  2569.  
  2570.   tex2c: Filesize reduced from 12672 -> 9768 bytes.
  2571.   tex2c: Speed increase on prog.tex: 35x faster (from RAM:)
  2572.   tex2c: Time savings on prog.tex: 67 seconds. (From HardDrive)
  2573.   tex2c: Time savings on complete make: 317 seconds (5 minutes, 17 seconds)
  2574.          (From HardDrive)
  2575.  
  2576.   All times were measured on Chaos_2.0 source files.
  2577.  
  2578.   tex2c: Now works as tex2c filename rather than tex2c <filename.
  2579.   tex2c: All output files are identical with the old tex2c.
  2580.   tex2c: No assembly language used in order to help preserve
  2581.          multiplatform compatability.
  2582.  
  2583.   tex2c: Read source code for more detailed timing tests and exact
  2584.          description of changes made.
  2585.  
  2586. ************* END tex2c speed upgrade *******************
  2587.  
  2588. * Replaced code segments with ClearUnder in 4 spell files.
  2589. * Replaced several code segments in .tex files with ClearUnder.
  2590. * All appropriate code segments have been replaced with ClearUnder now.
  2591.  
  2592. * Ok, now I did "smake newspell" and the filesize INCREASED from
  2593.   1552980 to 1628116!!!!!  There must be some difference between smake dev
  2594.   and smake newspell.
  2595.  
  2596. * Replaced all appropriate code sequences with ClearVisbile
  2597.  
  2598. * I could not find any code sequences to replace with RestoreCell.
  2599.  
  2600. * Replaced all appropriate code sequences with BackUp.
  2601.  
  2602. * Above replacements were made to enhance readability and to make future
  2603.   enhancements easier.  Some future strange enhancemnt to the cell
  2604.   structure can now be integrated into the game by just changing the
  2605.   routines in core.tex. (theoretically).
  2606.  
  2607. * BUG: Wizard kills some creatures.  Wizard mounts something.  Mount dies
  2608.   permanently.  Wizard's vanquished foes info not copied into
  2609.   cell.vanquished.  FIXED by replacing a code sequence with
  2610.   RestoreCellWizard in Reinstate.
  2611.  
  2612. * BUG: same as above but with collapsing meditations.  FIXED by inserting
  2613.   RestoreCellWizard into CollapseMeditation.
  2614.  
  2615. * BUG: Collapsing mediations does RestoreCellWizard on the wrong wizard,
  2616.   with disasterous consequences. (another off by 1 error).  FIXED.
  2617.  
  2618. * All appropriate code sequences replaced with RestoreCellWizard.
  2619.  
  2620. * I could not find any code sequences to replace with BackUpCellWizard.
  2621.  
  2622. * Inserted version information compatible with the AmigaDOS version command.
  2623.  
  2624. * Fixed the smake archive to archive the time and datestamp of the files.
  2625.   This way I can cd to the graphics or spells directory and type:
  2626.   list since friday
  2627.   to see all the files that have been changed since last friday.
  2628.   Or I can do:
  2629.   list since 25-nov-97
  2630.   to see all the files that you have added/changed since November 25th.
  2631.  
  2632. * Fixed the bug with pressing alt-o while already in the alt-o menu.
  2633.  
  2634. **************************************************************************
  2635. ************************ ARTIFACTS UPGRADE *******************************
  2636. **************************************************************************
  2637.  
  2638. * Read the docs for complete instructions on Artifacts.
  2639.  
  2640. * New function:  InsertArtifact.
  2641. * New predicate: isArtifact.
  2642. * New predicate: isUnderArtifact.
  2643. * New predicate: isUnderScroll.
  2644. * New predicate: isIDstatic.
  2645.  
  2646. * Artifacts added to alt-o level editor.
  2647.  
  2648. * Hidden Artifacts implemented.
  2649.  
  2650. * Now that I have implemented hidden artifacts and scrolls I find that I
  2651.   cannot attack objects that belong to NOBODY.  I'm not fixing this right
  2652.   away so that I can play the game like this for a while and see what it is
  2653.   like.  The game does let me shoot objects belonging to NOBODY though.
  2654.   NOW FIXED.
  2655.  
  2656. * Made numerous changes to Reinstate so that killing any object that is
  2657.   covering a scroll or artifact does NOT destroy the scroll/artifact.
  2658.   This mainly consisted of replacing InsertCreature/ClearUnder sequences
  2659.   with RestoreCell/InsertCreature sequences.  btw: I REALLY like the new
  2660.   reinstate routine it is sooo much easier to understand than the old one!
  2661.  
  2662. * Also had to make changes to InsertCorpse to not destroy scrolls and
  2663.   artifacts.
  2664.  
  2665. * New functions to support the above 2 items: InsertCreatureUnder and
  2666.   InsertCorpseUnder.
  2667.  
  2668. In general, if a creature dies while on top of a scroll then the corpse
  2669. for the creature goes to the underpart and the scroll goes to the top part.
  2670.  
  2671. If an inanimate object dies which is covering a scroll or artifact then
  2672. the scroll/artifact is no longer destroyed but instead goes to the visible
  2673. part of the cell.
  2674.  
  2675. * Hidden scrolls and artifacts are now fully supported by core.tex.
  2676.   You can now "dig up" buried scrolls and artifacts.
  2677.   You can now have wars over a particular scroll, with one creature
  2678.   moving onto the cell and being killed by another creature who is then
  2679.   killed by yet another, ad infinitum and the scroll won't be destroyed.
  2680.  
  2681. * Made 2 fixes to move.tex to prevent Thundermare and Iridium
  2682.   transformations from destroying scrolls underfoot.
  2683.  
  2684. * Set CAST_ARTIFACT on all appropriate magic spell files.  At the moment
  2685.   CAST_ARTIFACT is set only on spells that have CAST_LIVING set.  All
  2686.   spells which have CAST_LIVING set also have CAST_ARTIFACT set.
  2687.   This way artifact creatures are treated just like any other creature
  2688.   for purposes of spell-casting.
  2689.  
  2690. * Please don't forget to set CAST_ARTIFACT on any new magic spells that you
  2691.   make (if needed).  Most every spell that can be cast on creatures should
  2692.   be castable on Artifacts also. (since artifacts are just a special type
  2693.   of creature, like undeads are a special type of creature.)
  2694.  
  2695. As I was going through the spell files I noticed that Orcs is CAST_FREE?
  2696. And when you actually cast an Orcs spell it says at the bottom that the
  2697. range is 0 but in fact it is 1.
  2698.  
  2699.  
  2700. I added Artifacts to the game for the following primary reasons:
  2701. 1) It adds the "Capturing Neutral Equipment" play-mechanic to the game.
  2702. 2) It adds the "Capturing Enemy Installations" play-mechanic to the game.
  2703. 3) Provides extra incentive to players to hold a particular position, as
  2704.    opposed to hiding in the corner.
  2705.  
  2706. How good artifact gameplay actually is in real games will have to be
  2707. determined by playtesting.  Although I note that when I added scrolls I
  2708. began doing crazy things that I wouldn't have otherwise done, such as
  2709. charging my wizard TOWARDS powerful enemy creatures (instead of AWAY as
  2710. usual) in order to grab a good scroll before they could get it.
  2711.  
  2712. **************************************************************************
  2713. ********************** END ARTIFACTS UPGRADE *****************************
  2714. **************************************************************************
  2715.  
  2716. I just started up a test game to test all the new features and I started
  2717. out the game with a THUNDERMARE in my spell list.
  2718.  
  2719. A bipedal generator just generated a Brown Bear.  But bears are quadrupeds
  2720. not bipeds.  Shouldn't this be fixed?
  2721.  
  2722. Hmmm... Now I am playing a game with 4 generators... 2 of them are bipedal
  2723. generators.  Bipedal Generator1 produced this sequence of monsters:
  2724. Derro, Derro, Bear, Bear.
  2725. Bipedal Generator2 produced this sequence of monsters: Halfling, Halfling,
  2726. Halfling, Halfling
  2727.  
  2728. *************** Scrolls Improvement Upgrade ****************
  2729.  
  2730. * Hidden Scrolls implemented.
  2731.  
  2732. * Inanimate objects can no longer pick up scrolls.
  2733.  
  2734. * Fixed spiders to use the InsertCreatureUnder function when laying webs.
  2735.  
  2736. * Changed spider description to say that it eats scrolls. (since the
  2737.   act of laying a web destroys any scroll that may have been underneath it.)
  2738.  
  2739. * REMOVED the ChooseYourBonusSpell option from the setup screen II and just
  2740.   set it to always be on.  IMHO having it off is no fun so it should just
  2741.   always be on. (and we've completely run out of room on setup screen II).
  2742.  
  2743. * Scroll delay implemented.  So now it is _very_ possible to have wars over
  2744.   scrolls.  You can set the scroll delay to 3 turns and then you must take
  2745.   the cell and HOLD it for 3 turns straight.  If someone dislodges you from
  2746.   the cell before 3 turns is up then you don't get the scroll and must retake
  2747.   it and start over.
  2748.  
  2749. BUG: Ropers destroy whatever they are standing on when teleporting.
  2750. (corpses/scrolls/artifacts)  Oops no it doesn't.  When the roper teleports
  2751. it takes whatever it is standing on with it.  Interesting.
  2752.  
  2753. * BUGS: Roper scrolls teleport, growth scrolls alter growth rates, Spider
  2754.   scrolls lay webs, Haunt scrolls change sides, meditation scrolls
  2755.   collapse, spriggan scrolls "take a kip".  ALL FIXED NOW.
  2756.   These bugs wouldn't have happened if scrolls were "dead".  But perhaps
  2757.   setting the deadbit on scrolls would cause other bugs?  Who knows?
  2758.   For now I have simply added an isScroll check to wherever I find bugs
  2759.   related to scrolls.  It is easy and it works.
  2760.   
  2761. ************** End Scrolls Improvement Upgrade **************
  2762.  
  2763.  
  2764. * Replaced a couple of the old wizards[] references with Wizards[] in
  2765.   core.tex.
  2766.  
  2767. * Replaced a couple of the old wizards[] references with Wizards[] in
  2768.   cell.tex.
  2769.  
  2770. * Replaced several of the old wizards[] references with Wizards[] in
  2771.   warp.tex.
  2772.  
  2773. * Replaced all wizards[] with Wizards[] in init.tex.
  2774.  
  2775. * core.tex, cell.tex, warp.tex, init.tex are now completely free of old
  2776.   wizards[] references.
  2777.  
  2778. * Replaced all (except 1) of the old wizards[] references in predicate.tex.
  2779.  
  2780. * Replaced 2 of the old wizards[] references with Wizards[] in prog.tex.
  2781.  
  2782.  
  2783. ***********************************************************************
  2784. ********** Artificial Intelligence Spell Selection Upgrade ************
  2785. ***********************************************************************
  2786.  
  2787. * I am seriously looking at spell.tex for the very first time.
  2788.  
  2789. * Improved computer spell selection by using ObeySpellCastingRules.
  2790.   This should completely eliminate all the really stupid casts where the
  2791.   wizard tries to cast an impossible spell due to there not being any legal
  2792.   targets. (Such as casting Raise Dead when there are NO corpses in range.)
  2793.  
  2794. * BUGS: Computer wizards were cheating!  They were going through their
  2795.   ENTIRE spell list and casting any spell they wanted!  And they were going
  2796.   through their entire spell list and discarding any spell they wanted!
  2797.   NOW FIXED BY changing max to min in the following line in
  2798.   IntelligentComputerSpellSelect and ComputerSpellDiscard.
  2799.  
  2800.   int look = max (LOOKAHEAD, Spells);
  2801.  
  2802. * ObeySpellCastingRules is now more sensibly known as isIllegalCast.
  2803.  
  2804. * New function: isStupidCast.
  2805.  
  2806. * Improved computer spell selection by using isStupidCast along with
  2807.   isIllegalCast.  Now if a wizard contemplates casting combat but his only
  2808.   legal targets are enemy creatures or his own combat aerial servant he
  2809.   will simply decide that casting combat in this situation would be stupid
  2810.   and will cast something else instead.
  2811.  
  2812. * ADDED lots of extra checks for spells to probably not cast while double
  2813.   or triple is in effect.
  2814.  
  2815. * ADDED complete stupidity checking regarding multiple wizard powerups.
  2816.  
  2817. * Having a working game load/save feature really helped me debug the AI the
  2818.   last few days.  Thanks Sean!
  2819.  
  2820. * FLAW: A computer wizard was in a tree.  There were several legal targets
  2821.   for the slow spell that he cast but unfortunately, all the targets were
  2822.   already speed 1 so the spell was really wasted. NOW FIXED.
  2823.  
  2824. * SMALL FLAW: A computer wizard in a Dark Citadel just cast Speed on his
  2825.   Floating Eye.  I'm sure he had at least a few other spells that would
  2826.   have been better.  NOW FIXED.
  2827.  
  2828. * FLAW: A computer wizard cast Sanctuary on himself even though he
  2829.   already had Recover Boost.  (He had no creatures on the board).  He
  2830.   should have cast any one of a number of other better spells.  NOW FIXED.
  2831.  
  2832. * Numerous other flawed spell selections fixed using the same method as
  2833.   above.  This new "look before you cast" strategy is really working out
  2834.   nicely!  The only strategy game that might be better than Chaos is
  2835.   Chaos Coding.
  2836.  
  2837. If you notice a computer wizard casting a spell and then aborting it due to
  2838. no legal/nonstupid targets then please let me know. (or just fix it).  It
  2839. should NEVER happen unless the creature he was planning to cast it on gets
  2840. killed before his casting phase.  Or if his line of sight becomes blocked
  2841. (for example by another wizard casting lots of walls between him and the
  2842. intendend target.)
  2843.  
  2844. ***********************************************************************
  2845. ******* END Artificial Intelligence Spell Selection Upgrade ***********
  2846. ***********************************************************************
  2847.  
  2848. BUG:  I just surrounded a computer wizard with weak walls.
  2849. (He had already selected Lightning as his spell).  When it became his
  2850. turn to cast he cast it on one of my weak walls.  The
  2851. wall then had 83 life points.  Please fix. Fixed by SAI.
  2852.  
  2853. ***********************************************************************
  2854. *********************** Music System Upgrade **************************
  2855. ***********************************************************************
  2856.  
  2857. * After ages of hacking and slashing music asm code I am now ready to
  2858.   integrate the new music playback system into Chaos.
  2859.  
  2860. * Downloaded and installed util/pack/xpk_Develop.lha so I can assemble
  2861.   player.asm -> player.o 
  2862.   New music system supports compressed music IF you have xpk libraries
  2863.   installed; otherwise it doesn't.  xpk libraries NOT required.  It is
  2864.   just an extra added option for someone who wants to replace the game
  2865.   music with their own (compressed) music.  Or perhaps we will use
  2866.   compressed music at some point. Who knows?
  2867.  
  2868.   Here is what I did with xpk:
  2869.   Put the archive into t:
  2870.   lha x #?
  2871.  
  2872.   cd t:xpk_develop/include/c
  2873.   copy all to include: clone
  2874.  
  2875.   cd t:xpk_develop/include/asm
  2876.   copy all to include: clone
  2877.  
  2878.   cd t:xpk_develop/autodocs
  2879.   copy all to include:autodocs clone
  2880.  
  2881. I didn't know where else to put the autodocs...
  2882.  
  2883. I have no particular plans for using xpk from C but you never can tell what
  2884. the future will hold so I installed the C files for completeness.
  2885.  
  2886. * Commented out EVERYTHING to do with the awful ptreplay.library.
  2887.  
  2888. * Music.lib
  2889.   In preparation of the new music system I have joined 27 files into 1
  2890.   music.lib file which contains all the asm code related to the new music
  2891.   system. (12 .asm files, 12 .o files and 3 .i files.)  All those files must
  2892.   reside in INCLUDE: in order to assemble correctly and since I don't feel
  2893.   like reading the instructions to figure out how to make them assemble from
  2894.   any directory it is just easier to assemble them like that and then whack
  2895.   them all into one big 32k music.lib which can be easily included in the
  2896.   archive.
  2897.  
  2898. * Chaos is currently 1100836 bytes.  After linking with the new music
  2899.   system it is now   1100836 bytes!  Either slink is much better or much
  2900.   worse than I thought it was!  I just linked with the 32k music.lib and
  2901.   either slink didn't do it or it noticed that there are are NO calls to
  2902.   any functions in the .lib file currently so it intentionally didn't
  2903.   include it. Yes that must be it.
  2904.  
  2905. * In a frantic attempt to get ciab.resource to open (it always failed) I
  2906.   commented out all the timing code from Chaos.  Still didn't work.  Ok,
  2907.   now I figured it out.  A damn misplaced semicolon...
  2908.  
  2909.   Ok I just tried to link in the music.lib while actually referencing 1
  2910.   variable from music.lib and I just got TONS of undefined variable errors.
  2911.   Looks like I must do a LOT more hacking and slashing.
  2912.  
  2913.   Ok I've reduced it from 46 errors to 25.   This is the first time it has
  2914.   actually compiled into a file:
  2915.   1099680 -> 1125768 bytes  so it seems to have only added 26k.  WOW, if
  2916.   that value holds then that is EXCELLENT!  Much better than the 40k I
  2917.   thought it was going to be!
  2918.  
  2919.   Details of what I did to force the new music system into Chaos appear in
  2920.   the file INCLUDE:errorlistmusic. (2.6k)  and more info is in the asm
  2921.   source player.asm
  2922.  
  2923. * WOOHOO!  Successfull linkage of music.lib with Chaos achieved on
  2924.   Sunday, December 14th, 1997.  That was just to get it all linked
  2925.   together.  I haven't put any code in Chaos to actually call any of the
  2926.   routines in music.lib yet so there is still much to do.
  2927.  
  2928.  
  2929. * ROUTINES in music.lib:
  2930. *** setsong - Start playing a different song in the current module
  2931. * d0 = Song number to start playing
  2932.  
  2933. *** loadmod - Load a module without playing it
  2934. * a0 = Pointer to filename
  2935. * Returns: d0 = Null if successful, pointer to error message if failed
  2936.  
  2937. *** playmod - Play an already-loaded module
  2938. * d0 = Song number (-1 = user's choice)
  2939. * Returns: d0 = Null if successful, pointer to error message if failed
  2940.  
  2941. *** startmod - Load a module and start it playing
  2942. * a0 = Pointer to filename
  2943. * d0 = Song number (-1 = user's choice)
  2944. * Returns: d0 = Null if successful, pointer to error message if failed
  2945.  
  2946. *** contmod - Continue a module from where it left off
  2947. * Returns: d0 = Null if successful, error message if failed
  2948.  
  2949. *** contplaymod - Continue current module if possible, otherwise restart it
  2950. * Returns: d0 = Null if successful, error message if failed
  2951.  
  2952. *** stopmod - Stop a playing module
  2953. * Returns: d0 = NULL
  2954.  
  2955. *** endmod - Stop and unload a module
  2956. * Returns: d0 = NULL
  2957.  
  2958. There are other routines for changing playback speed and volume but I
  2959. haven't worked out how to use them yet.
  2960.  
  2961. So all we need for the intro music is
  2962. startmod("filename",0);
  2963. // blah blah blah
  2964. endmod();
  2965.  
  2966. YAY!  IT REALLY WORKS!!!
  2967.  
  2968. 2 small problems though:
  2969.  
  2970. 1) The current sound effects system opens up and
  2971.    hogs 1 audio channel throughout the entire game.  If it does this while
  2972.    the music is playing then it messes up the music.  I worked around this
  2973.    by moving the code that opens the audio.device and hogs the channel so 
  2974.    that it is no longer in CommenceChaos but rather right at the end of the
  2975.    setupscreens.
  2976.  
  2977. 2) It is incompatible with Say();  calling Say while
  2978.    music is playing screws up the timing of the music and makes it sound
  2979.    awful.  However, playing a sampled sound during the music does WORK
  2980.    PERFECTLY!  So we must either:
  2981.    A) Not play music while using Say();
  2982.    B) Not use Say(); while playing music.
  2983.    C) Make some sort of workaround for Say();  However I have no idea how
  2984.       to approach the idea of making a workaround.  I guess Say messes up
  2985.       the CIA timing registers?  Perhaps the AmigaSpeech just plain isn't
  2986.       truly system friendly?  Who knows?
  2987.  
  2988. For now I will comment out the line that says "Welcome to the Magic Zone"
  2989. so that the music can play during the setup screens.  It will be a simple
  2990. matter to replace this Say(); with an actual sampled sound file. (Something
  2991. I've been planning to do for months anyway).
  2992.  
  2993. Actually it could be WaitForSay(); that causes the incompatability for
  2994. all I know.
  2995.  
  2996. * 218K of asm source code was used to produce music.lib.
  2997.  
  2998. Now that the new music system is _finally_ in and working:
  2999.  
  3000. * ADVANTAGES of new music system vs. ptreplay.library.
  3001.   1. It actually works.
  3002.   2. It works on MC68000 processors unlike ptreplay.library.
  3003.   3. It can play SoundTracker/NoiseTracker/MutantTracker/ProTracker music
  3004.      without messing them up like ptreplay.library did.
  3005.   4. Also supports 8-channel Oktalyzer music. (untested at this time)
  3006.      ptreplay.library has no 8-channel support.
  3007.   5. It has a rudimentary IFF 8SVX sound sample play routine also.
  3008.   6. It was originally written by my good buddy Bryan Ford the MEGACODER.
  3009.   7. It is very easy to add med/octamed support should we decide to do so.
  3010.   8. It is very easy to add support for a BUNCH of other music formats but
  3011.      those other formats are all irrelevant AFAIK.
  3012.   9. MOST IMPORTANTLY: It _shares_ the sound channels in a system friendly
  3013.      manner!!!  Something that _NO_ other replay routine does!!! (That I
  3014.      know of or could find any evidence of or have even heard of.)
  3015.  
  3016.      Sharing the sound channels _may_ be desirable in the general game so
  3017.      that music can be playing while the sound effects are playing too.
  3018.      However this may sound too jarring with multiple sound effects being
  3019.      played.  Only experimentation will tell.
  3020.  
  3021.      Sharing the sound channels _IS_ _DEFINITELY_ required for a truly
  3022.      system friendly and multitasking game.  If the player routine doesn't
  3023.      share the channels then the AmigaOS DisplayBeep(); function CANNOT
  3024.      make any sound!  This is unacceptable IMHO.  Especially when you are
  3025.      sorting your database or copying a disk or browsing the web while
  3026.      the game music is going on.
  3027.  
  3028.      I investigated many, many replay routines and NONE of them shared the
  3029.      sound channels.  They all just hogged all 4 channels and wouldn't let
  3030.      any other sounds get through no matter how important the sound was!
  3031.  
  3032. * DISADVANTAGES of new music system vs. ptreplay.library.
  3033.   1. Takes 26k instead of only 10k.
  3034.   2. It might be a LOT slower.  I just don't know.  We need to somehow test
  3035.      its speed by running a program and timing it then running the same
  3036.      program again with the music going and see if there is a speed
  3037.      difference.
  3038.   3. It isn't a shared library so it can't be flushed out in a low memory
  3039.      situation.
  3040.   4. It doesn't have volume fade in/out because I haven't got around to
  3041.      implementing that yet.  This isn't really a disadvantage though since
  3042.      the volume fade in/out of ptreplay.library caused crashes anyway.
  3043.  
  3044.  
  3045. * DELETED all code related to ptreplay.library.
  3046.  
  3047. * In the future I might remove the 8-channel music support if we don't end
  3048.   up using my 8-channel music or if the 8-channel playback doesn't work 100%
  3049.   That would save several K.
  3050. * In the future I might add volume fading in/out.
  3051.  
  3052. * All in all, Chaos now has a better music playback system than any other
  3053.   Amiga game.  Most games have an option for music OR sound effects but
  3054.   Chaos can have BOTH if we so desire.
  3055.  
  3056. * AAAUUUUGGHH!!!!  I just did a DisplayBeep during the music and the music
  3057.   PERMANENTLY lost a sound channel!!  It also caused some other glitches in
  3058.   the music playback.  I don't understand this.  I can play sampled sounds
  3059.   all day long from the CLI and everything works perfectly... I don't know
  3060.   why this music system is not cooperating with DisplayBeep and Say.
  3061.   Ok, I changed my preferences: I changed the sound type from "beep" to
  3062.   "sound sample" now the display beep makes NO noise and doesn't steal a
  3063.   channel.  !?!?!  For "beep" to make a sound and "sound sample" to not
  3064.   make a sound in DisplayBeep means that there must be a bug in the OS.
  3065.  
  3066.   This whole situation also means that there must be some secret coding
  3067.   technique that is used in the way I play my sound samples from the CLI
  3068.   that allows it to borrow a sound channel, use it and then give it back
  3069.   without causing any damage.  This will all require a lot more
  3070.   investigation.
  3071.  
  3072. ***********************************************************************
  3073. ******************** END Music System Upgrade *************************
  3074. ***********************************************************************
  3075.  
  3076. BUG? I was playing a nice little game... I had surrounded a bipedal
  3077. generator except for 1 cell.  I just cast a faun into that cell. Then it
  3078. said "Banderlog sleep" and my Red Dragon was put to sleep and instantly
  3079. collapsed!  ARGH!  There are no banderlog's on the screen!  Could my Faun
  3080. have cast sleep on my own creature?
  3081.  
  3082. The exact same thing just happened again! This time my gorilla got put to
  3083. sleep!  I think maybe I am casting creatures onto a dead banderlog.
  3084.  
  3085. Now I'm in a completely different situation and my Faun just put my harpy
  3086. to sleep.  This faun has killed more of my creatures than the enemy has.
  3087.  
  3088. Now my other faun on the other side of the board put my manticore to sleep.
  3089. I guess Fauns just cast their sleep spell on anybody...
  3090.  
  3091. Now my faun put my Crocodile to sleep.
  3092.  
  3093.  
  3094. I had always intended that you press the "c" / "r" / "s" / "m" keys ONCE
  3095. and the color cycling would take care of the flashing for you.  But I just
  3096. now accidentally held the "c" key down for a while and it started flashing
  3097. completely on/off in an almost acceptable manner.
  3098.  
  3099.  
  3100. ***********************************************************************
  3101. **************** Efficiency Upgrade Speed/Memory **********************
  3102. ***********************************************************************
  3103.  
  3104. **********************        Part 1       ****************************
  3105. ********************** __near data upgrade ****************************
  3106.  
  3107. * SOLUTION to near/far data problem.  There is no problem!  The compiler
  3108.   defaults to always using FAR data.  But this is easily overridden by
  3109.   using the __near keyword on any varibles that we want to keep in the near
  3110.   64k dataspace.  Keep in mind that some vars are accessed in the asm code
  3111.   as FAR so we have to leave those as FAR (or add the __near keyword AND
  3112.   edit the asm code).  So if you ever have a variable that gets used a lot
  3113.   then feel free to use the __near keyword on it.
  3114.  
  3115. * As a test I will just make board be a __near variable.
  3116.   1126496 -> 1123868 Cool! Saved 2628 bytes! This savings should
  3117.   translate at a 3:1 ratio so that's about 876 bytes saved on smake
  3118.   release.  Don't forget __near variables are faster too.
  3119.  
  3120. * More C lameness: I just moved a bunch of variables from far to near in
  3121.   prog.tex.  I only recompiled prog.tex and start.tex to quickly eliminate
  3122.   the simple errors.  Yet it compiled and linked perfectly!!!  Even though
  3123.   there were TONS of far references to variables that were now defined and
  3124.   initialized as being in the __near data section!  I couldn't believe my
  3125.   eyes!  I knew there was NO way such a program could possibly run but I
  3126.   wanted to prove it so I ran this newly compiled Chaos and sure enough
  3127.   *BOOM*.  Up came the requester: "Software failure: Suspend or Reboot".
  3128.  
  3129. * After switching over all appropriate variables in prog.tex from far to
  3130.   near: The filesize is now 1113932 for a total savings of 12564 bytes.
  3131.  
  3132. * Ok, I rummaged around through all the other .tex files and transferred
  3133.   over a few variables here and there to __near. Even changed vp in the
  3134.   C and asm code to be near. Filesize is now
  3135.   1112396 325868
  3136.  
  3137. * Changed vp to be near (in asm code too).  DID NOT WORK no matter what I
  3138.   did. 8(
  3139.  
  3140. * __near vs. __far
  3141.      4         6     Bytes of code required to access the variable.
  3142.     12        16     Cycles required to access byte or word variable on 68000.
  3143.     16        20     Cycles required to access long variable on 68000.
  3144.   
  3145.   move.l var(a4),d0    Asm near var.
  3146.   move.l var,d0        Asm far  var.
  3147.  
  3148.   GRAND TOTAL SAVINGS: 14100 bytes.
  3149.  
  3150. ******************* END __near data upgrade ***************************
  3151.  
  3152. **********************        Part 2       ****************************
  3153. **********************    Macros Upgrade   ****************************
  3154.  
  3155. int t3=board[c].char_stat.Stat; Produces the following asm code:
  3156. move.l    d4,d0            ;  4 cycles
  3157. asl.l    #2,d0            ; 12 cycles
  3158. sub.l    d4,d0            ;  6 cycles
  3159. asl.l    #2,d0            ; 12 cycles
  3160. sub.l    d4,d0            ;  6 cycles
  3161. asl.l    #3,d0            ; 14 cycles
  3162. movea.l    a0,a1            ;  4 cycles
  3163. adda.l    d0,a1            ;  6 cycles
  3164. move.l    0014(a1),0018(a7)    ; 28 cycles
  3165.  
  3166. GRAND TOTAL CYCLES:        ; 92 cycles
  3167. GRAND TOTAL BYTES :             ; 22 bytes
  3168. The above code is actually much smaller and faster than I expected.
  3169.  
  3170. Now look at the code generated by:
  3171. int t4=cell->char_stat.Stat;
  3172. move.l    0014(a5),0014(a7)    ; 28 cycles.  3.28x faster than above!
  3173.                 ;  6 bytes.
  3174.  
  3175. So we can basically save 16 bytes and 64 cycles each time we use a new
  3176. IsUndead(cell) macro instead of an old isUndead(cell) macro.
  3177.  
  3178. * NEW PROGRAMMING RULE: macros which start with a lowercase letter
  3179.   (isUndead) require a numerical parameter while macros that start with an
  3180.   uppercase letter (IsUndead) require a pointer to a playCell structure.
  3181.  
  3182. * Changed: AttacksLiving into attacksLiving and AttacksUndead into
  3183.   attacksUndead.
  3184.  
  3185. * All "is" macros now also have an "Is" form in predicate.tex.
  3186.  
  3187. At the beginning of this project the size of Chaos is:
  3188.   1112396 / 325868 bytes.
  3189.  
  3190. * CHANGED isFlying from a function into a macro.
  3191.   1112208 / 325844 Saved 24 bytes.
  3192.  
  3193. * Made "Is" versions of "is" functions in predicate.tex plus optimized the
  3194.   "is" functions.
  3195.   1112572 / 325904 Lost 60 bytes but saved 64/128 cycles here and there.
  3196.  
  3197. * Edited spell.tex:
  3198.   1112620 / 325804 Saved 100 bytes.
  3199.  
  3200. * Edited cast.tex:
  3201.   1112568 / 325664 Saved 140 bytes in isIllegalCast
  3202.   1112020 / 325004 Saved 660 bytes in isStupidCast
  3203.   1111888 / 324800 Saved 204 bytes in DoComputerCast
  3204.   1111832 / 324672 Saved 128 bytes in Drainer
  3205.   1111796 / 324560 Saved 112 bytes in PlasmaBeamHandler  
  3206.   1111804 / 324536 Saved  24 bytes in Multiplicity
  3207.   1111728 / 324432 Saved 104 bytes in CastSpells
  3208.   1111732 / 324432 Saved 000 bytes in PossibleChoice ???
  3209.   1111716 / 324400 Saved  32 bytes in Generate
  3210.   TOTAL SAVED cast.tex  1404 bytes.
  3211.  
  3212. * "c" key is faster now that spell.tex and cast.tex have been optimized.
  3213.  
  3214. * Edited cell.tex (ReDrawCell + AutoAccept)
  3215.   1111684 / 324288 Saved 112 bytes.
  3216.  
  3217. * Edited prog.tex:
  3218.   1111588 / 323316 Saved 972 bytes by removing AnColBackup and AnRowBackup.
  3219.   1111088 / 322828 Saved 488 bytes in Animator.
  3220.   1110600 / 322444 Saved 384 bytes in HandleIDCMP.
  3221.   1110608 / 322428 Saved  16 bytes in HandleMOUSEMOVE.
  3222.   1110556 / 322352 Saved  76 bytes in GetSpellSelection1.
  3223.   1110076 / 321924 Saved 428 bytes in BoardUpdate.
  3224.   1109988 / 321816 Saved 108 bytes in CalculateArtifactOwners.
  3225.   1109900 / 321712 Saved 104 bytes in PickUpScrolls.
  3226.   1109908 / 321704 Saved   8 bytes in main.
  3227.   TOTAL SAVED prog.tex  2584 bytes.
  3228.  
  3229. * Edited info.tex:
  3230.   1109592 / 321320 Saved 384 bytes in ExtraDisplay.
  3231.   1108544 / 320380 Saved 940 bytes in InformationPanel1.
  3232.   TOTAL SAVED info.tex  1324 bytes.
  3233.  
  3234. Running out of time.  SI needs new archive by Dec. 22nd so the "Efficiency
  3235. Upgrade" is being placed on hold for now.
  3236.  
  3237. ****** TEMP END of Efficiency Upgrade Speed/Memory ***************
  3238.  
  3239. * Absorbed flashywin.c into Chaos.  Only added about 400 bytes to the
  3240.   executable release.
  3241.  
  3242. * Quadrascope and Spectrogram added to the setup screens to go along with
  3243.   the music.
  3244.   After some hacking and slashing and rearranging I got everything to work
  3245.   and be compatible with the quadrascope and spectrogram.  I had to make
  3246.   some adjustments to the GameGadgets code and rearrange some things and
  3247.   add some lines of code here and there.
  3248.  
  3249. * #define CheckPixelArrays(blah)  Saved about 1000 bytes.
  3250.  
  3251. * Set nasty_audio for the music player to prevent displaybeep from
  3252.   permanently stealing a channel when you overflow a text entry gadget.
  3253.  
  3254. * BUG: When a creature is engaged it can still "attack" an empty cell and
  3255.   move onto it.  NOW FIXED for human players.  This bug may still exist
  3256.   for computer players.
  3257.  
  3258. BUGS: load and quit don't work on setup screen I.  No time to fix.
  3259. I don't really know how to fix them quickly because part of the problem is
  3260. adding gadgets that are already there or removing gadgets that are not
  3261. there.  I don't know much about gadgets so I won't muck about with this
  3262. now.  Just remember that the GameGadgets need to NOT be attached to window
  3263. during the setup screens but they DO need to be attached to the window
  3264. during the entire rest of the game.
  3265.  
  3266.  
  3267. * I made a smake release and tested it on my A2000 and disabled the chipram
  3268.   down to 512k to see if it would work.  IT DID!!!  AMIGA RULES!!!
  3269.  
  3270.   On a 1 meg Amiga with 512k chipram and 512 fastram here is the memory
  3271.   availability when the game is autobooted from a minimal boot disk with NO
  3272.   unneccessary stuff loaded and making use of the wonderful Add36k command.
  3273.   This is while running chaos with a standard stack of 4096 bytes.
  3274.   I wouldn't recommend using a stack bigger than 8000.
  3275.   
  3276.   btw: The disk is 94% full.
  3277.  
  3278.   Time:   Chipram Available:  Fastram Available:
  3279.   Intro   47496               55920
  3280.   Setup   56376               111592
  3281.   Game    205304              111320  (Examined while "about" screen was up.
  3282.   Game    256104              111320  (Just looking at the board.)
  3283.  
  3284.   The numbers for the Intro and Setup seem dangerously low to me.  It would
  3285.   only take *1* piece of fragmentation to cause them to fail.  Indeed, it
  3286.   seems like a miracle that it is working.  Maybe its a Christmas Miracle?
  3287.  
  3288.   I just can't imagine any W95 program running with only 55k of free ram
  3289.   and not crashing after 5 minutes or so.
  3290.  
  3291. I noticed that the whole game sounds different on the slower 7Mhz 68000.
  3292. The lineofsight routine is still too slow on 7Mhz 68000 as can be seen
  3293. by the delay in pressing the "c" key when trying to cast something with
  3294. long range that requires line of sight. (Like trees or castles).
  3295. Oh well, nothing can be done about that.
  3296.  
  3297. Sending an archive to SAI on Sunday December 21, 1997 for testing during
  3298. Christmas holidays.  Also sending an archive of my autobooting floppydisk
  3299. version for OS1.3 Amigas.
  3300.  
  3301. -------------------
  3302.  
  3303. * Adjusted alignment of scopes to allow them to run a bit faster.
  3304.   Saves 64 chipram reads and 64 chipram writes per frame drawn per scope.
  3305.  
  3306. * Rewrote the quadrascopes to run at 3x the framerate that they were running
  3307.   previously.  They now run at MAXIMUM speed (50 fps).  Quadrascopes are
  3308.   now much more "electric".
  3309.  
  3310. * Rewrote the spectrogram to run at 3x the framerate that it was running
  3311.   previously.  It now runs at MAXIMUM speed (50 fps). Also rewrote the
  3312.   \decspec routine in flash.asm to be much faster.  The spectrogram now
  3313.   descends much more smoothly. (1 pixel per frame instead of 3 pixels at
  3314.   once every 3rd frame.)
  3315.  
  3316. * Implemented a new jcspectrogram.  It is a  new version of the above
  3317.   spectrogram but this one has colors and is faster too. I left the old
  3318.   spectrogram intact in music.lib in case we want to use it in the future
  3319.   for some reason.
  3320.  
  3321. * Rewrote intflashnote in misca.asm to be faster and take less memory.
  3322.  
  3323. * Commented out most of the unused variables from misca.asm. SAVED 1808
  3324.   bytes on the music.lib filesize.
  3325.  
  3326. * Rewrote part of the Quadrascope to save 66,800 cycles per second on A500.
  3327.  
  3328. Christmas Eve playtesting with Joseph:
  3329. * BUG: Artifact ties were being awarded to the higher player number rather
  3330.   than to NOBODY.  NOW FIXED.
  3331.  
  3332.  
  3333. My brothers had not playtested Chaos in months.  They had completely lost
  3334. interest in the game.  Joseph even explicitly said that "I just don't have
  3335. the attention span required to play Chaos."  I thought that they would
  3336. never play it again... 8(
  3337.  
  3338. But I got Joseph to notice the game when he came into the room while I was
  3339. working on the speeded up Quadrascope so we got to talking about the new
  3340. features and within an hour of playing he was telling Jerry he should start
  3341. playing the game again because the "The game is really groovy now."
  3342.  
  3343. Joe and I played 2 games with about 20 hidden artifacts + 20 hidden scrolls
  3344. each. The first game we had only 20 spells and the next one we had 40 spells.
  3345.  We had 3 or 4 generators and a few computer players against us.  The game
  3346. had a whole different flavor as we went around mining for spells and
  3347. learning how to use artifacts.  We played where only wizards could pick up
  3348. spells.  I liked that a lot.
  3349.  
  3350. JJ and I played 2 games with 99 spells, Texas Trash'em, 20 UNhidden scrolls
  3351. and 20 UNhidden artifacts.  I was near death from turn 1 due to being near
  3352. too many enemy artifacts and generators but luckily I cast a Reflector
  3353. which set me up in a good safe position.  The game would have probably
  3354. lasted a very long time but JJ made a fatal mistake.  He took control of a
  3355. Damaged Dalek Artifact and shot my wizard (thinking he would kill me).
  3356. Of course the FULL brunt of the impact reflected back on the Dalek and it
  3357. died. So there was this dead dalek just laying there so I cast Raise Dead
  3358. on it and started chasing after his Wizard and killed him.  Game over man.
  3359.  
  3360. The next game was INCREDIBLY interesting...  The top 2 corners had simply
  3361. too many Computer Wizards and generators to venture near.  That left the
  3362. bottom right corner which was quite safe and quite devoid of usefull
  3363. scrolls and artifacts.  And the bottom left corner which had a Range Boost
  3364. Scroll and a Double Scroll and 2 Bolter Wall artifacts with NO generators
  3365. or enemy wizards nearby. 
  3366. First turn:
  3367. I cast a pegasus so I could get over to the corner ASAP. That
  3368.  was my fastest creature.  I didn't have a teleport.
  3369.  
  3370. JJ cast Teleport and was IMMEDIATELY in a GREAT position in the bottom left
  3371. corner.
  3372.  
  3373. I dediced "Damn the bolter walls!  Full speed ahead.
  3374.  
  3375. Turn 2: I get shot by the bolter wall which JJ now controls but I
  3376. psychotically decide not to retreat.
  3377.  
  3378. Turn 3: I move my pegasus as close to the botom left corner as possible.
  3379. Which is still 2 squares away from the bolter wall.  I get shot by the
  3380. bolter wall again AND some other guy's dragon breathes on me and kills my
  3381. Pegasus.  So my wizard is just standing there exposed.
  3382.  
  3383. Turn 4: I cast a creature next to the bolter wall and made it back to being
  3384. nobody's.
  3385.  
  3386. I don't remember the exact way things happened from there on out but all I
  3387. know is that each individual turn I was in SEVERE danger of dying.  I had
  3388. to cast the EXACT right spell in the exact right way to survive.  It was an
  3389. enormous power struggle for control of that corner.  Each turn I ALMOST got
  3390. the upper hand and became powerful but each turn my plans were thwarted by
  3391. JJ. At one point I had my wizard and elephant next to the bolter wall so it
  3392. was GOING to become mine after we cast spells.  This means I was going to
  3393. win (bolter wall hit plus elephant hit on his wizard = death)  But then he
  3394. gave up fighting for the artifact and cast brain drain on it.  I was sorely
  3395. tempted to cast Raise Dead on it but *I* was also about to die immediately
  3396. so I couldn't. 
  3397. He cast a lion to go around my elephant and eat my wizard so I HAD to
  3398. cast sleep on the lion right that turn.  Problem solved, except that he
  3399. cast FREE on my elephant!!!!  ARGH!!!!  Then he woke up his Lion!!!  I had
  3400. just finally cast cloak but after all the attacks that round even with my
  3401. cloak I was down to 2 points of life.  So I had to retreat back to the
  3402. middle of the board which was basically empty except for a bolter wall
  3403. artifact and a dalek artifact.  Once I quit psychotically trying to attack
  3404. that corner I became quite powerful.  Instead of just trying to survive from
  3405. one turn to the next in a defensive manner I was able to concentrate on
  3406. trying to do something more offensive in nature.  hehehehe  Like I cast a
  3407. wall spell around his wizard and boxed him in on the side of the screen and
  3408. made him abort his undead creature! hehehehe.  Then the FREED elephant
  3409. killed his lion and an enemy bear has wandered into the corner so he is now
  3410. in an interesting position. By then it was 1:00 A.M. so we saved the game
  3411. and he went to bed.
  3412.  
  3413. I would NEVER have played so agressively in the olden days.  But all that
  3414. kewl stuff in the corner activated the "greed factor" in us so we all went
  3415. there to fight over it.
  3416.  
  3417. Christmas day playtesting with Jerry, Joseph and JJ.
  3418. * BUG: Inanimate objects are exerting influence on artifacts. NOW FIXED.
  3419.  
  3420. * BUG: Joe cast Magic Bolt on a web and it increased the web's life to 33
  3421.   points or something. Now REALLY fixed.
  3422. * BUG: I cast a Magic Bolt on a freshly generated skeleton.  The skeleton
  3423.   then had 25 life points! Now REALLY fixed.
  3424.  
  3425.  
  3426. BUG: computer wizard cast dark citadel several squares away.
  3427. BUG: computer wizard cast alliance and nothing happened. Maybe he aborted
  3428. it?
  3429.  
  3430. Ok, I'm home now and looking at the bolt bug.  The *= -MSF fix is there in
  3431. the spell file.  (I put it in the day you gave it to me.)  But SOMEHOW it
  3432. is not in castmagic.c!!!!!!!  ARGH!!!!!!!!!!!!!!  Hmmm... I could have
  3433. sworn I did a smake clean before I did smake release....  I guess maybe
  3434. smake clean doesn't rebuild the castmagic.c....  The date on castmagic.c is
  3435. December 5th!!!  oh well... I am doing a smake newspell now, then a
  3436. smake release then we will playtest some more.
  3437.  
  3438.  
  3439. Re: new font.  I noticed that the fancy font was much easier to read on my
  3440. old Amiga 1084S monitor when I was testing the 1 meg version.  Something
  3441. about the fuzziness smooths it out or something.
  3442.  
  3443. BTW: We were all gathered around for Christmas dinner with jillions of
  3444. relatives and my dad asked me "Why can't I read the letters on my screen?"
  3445. He said he thought something was wrong with his computer or monitor.
  3446. Admittedly my dad has serious vision problems. His eyesight was HORRIBLE
  3447. but then he had corrective laser surgery done twice and his vision is much
  3448. better now.  He still wears contact lenses but they are many times less
  3449. powerful than his old ones.  As a quick fix I am disabling the fancy font.
  3450. Feel free to add a menu option for "Fancy Fonts" on the drop down menus if
  3451. you so desire.  He was using a 1084S monitor when he registered his
  3452. complaint.
  3453.  
  3454. Joe wants auto-switching with numeric keys.
  3455. Joe wants number of kills on score screen.
  3456. Joe is dying for the graphics upgrade to be implemented.
  3457.  
  3458. * Edited some spell descriptions and removed spell-casting ability from
  3459.   Faun because I really hated it and couldn't stand it any longer.
  3460.  
  3461. * Played more games of Chaos with relatives.  One of which I REALLY wish
  3462.   I'd saved on turn 1.  It was so incredibly strategic!  As it turned out,
  3463.   each individual player had to cast exactly the right spell in exactly the
  3464.   right spot for several turns or they would die.  It was AWESOME!  Totally
  3465.   cool!  Hopefully I will make a level like that someday.  (Only really
  3466.   works with exactly 3 players though.)  I ended up dying after several
  3467.   turns all because I cast the wrong spell on turn 2.
  3468.  
  3469. * FLAW: Wizards kept subverting/abducting/betraying artifacts.  NOW FIXED.
  3470.  
  3471. * Changed: Bipedal generators no longer produce bears.
  3472.  
  3473. * Changed: Moved end-of-turn gadget to be FAR away from question mark
  3474.   gadget.  My entire family has been bugging me about this for years. Every
  3475.   time we play they say "That shouldn't be there next to the question mark."
  3476.  
  3477. * Implemented jcquadragram (jcquadspectrogram).  I've always wanted to do a
  3478.   seperate spectrogram for each of the 4 sound channels for many, many
  3479.   years.  I've always wanted to watch the different notes of the same
  3480.   instrument "dance" as they play.  Only now that I have finally done it,
  3481.   it doesn't seem quite as cool as I had hoped.  Oh well, maybe others
  3482.   will have a different opinion.
  3483.  
  3484. * JCquadspectrogram has 32-note resolution.  The original spectrogram and
  3485.   jcspectrogram had only 16-note resolution.  In spite of the increased
  3486.   resolution it is still about the same speed as the original jcspectrogram
  3487.   due to the fact that it caches pixels in a register and then writes out
  3488.   whole words at a time to chipram instead of 1 byte at a time.
  3489.  
  3490. * l key for line of sight.  It works like the other keypresses execpt that
  3491.   this one simply shows all the cells that can be seen from the current cell.
  3492.   This is very useful if you are thinking of casting a certain spell that
  3493.   needs line-of-sight and you want to be sure that you have it.  Simply
  3494.   place the mouse pointer over your wizard and press "l" to see all the
  3495.   cells that he has line-of-sight into.
  3496.  
  3497. * Fixed it so that the game startup after setup screen II doesn't look so
  3498.   bad on slow machines.
  3499.  
  3500.  
  3501. SCREWEY BUG: The game has been working great for ages.  But suddenly,
  3502. every time I do a smake release the game crashes on setup screen I.  Yet if
  3503. I do smake clean  smake dev it works fine.  But then I do smake clean smake
  3504. release and it crashes on setup screen I.   I can do a smake release and 
  3505. then ONLY recompile init.tex as smake dev and everything works fine.
  3506. Totally strange.  What could be causing this???
  3507.  
  3508. * Ok I've worked around it by forcing init.tex to NOT compile with the
  3509.   "optimize" option.  Now everything is working perfectly again.
  3510.  
  3511. * The line of sight testing was just too slow on A500 so I rewrote
  3512.   isLineOfSight to burn up some memory but be 25% faster than before.
  3513.  
  3514. Joseph tried to design a level with your level editor but it went bonkers
  3515. when he tried to insert the wizards.
  3516.  
  3517.  
  3518. * EGADS!  I was looking around through the Protracker Replayer Asm code,
  3519.   trying to figure out how to implement my new instrument-flasher when I
  3520.   became aware of the fact that the internal data format and file format
  3521.   for protracker mods is horribly lame!  For example, the instrument #'s
  3522.   are stored as a byte.  But the upper 4 bits of the byte are stored as
  3523.   the upper 4 bits of byte 1 and the lower 4 bits of the byte are stored as
  3524.   the upper 4 bits of byte 3.  So all this anding, shifting and oring crap
  3525.   has to be done.  The net result is that the act of getting the current
  3526.   instrument number takes 7 machine instructions instead of 1 like it
  3527.   should.  YICK!  Oh well, at least I optimized it to now take only 6
  3528.   instructions.
  3529.  
  3530. * Due to the lame data format there are about 50 stupid anding instructions
  3531.   in the ptsplay asm code that wouldn't be needed if the file format made
  3532.   sense. However I have now optimized the code and eliminated 4 of them,
  3533.   saving 16 bytes and some cycles.
  3534.   But to eliminate the others would require a whole new file format.
  3535.  
  3536. I noticed there were many other optimizations that I could do but I would
  3537. need to use a temp register to implement them and I am unsure if it is safe
  3538. to do so in those routines.  Maybe I'll investigate it later.
  3539.  
  3540. * The archive was too big to fit on 1 720k floppy so I deleted the music
  3541.   from the archive.  The music has never changed since the day I first put
  3542.   it in anyway.  So for now the music/ dir won't be passed back and forth
  3543.   in the archive.
  3544.  
  3545. ***********************************************************************
  3546. ************************* 1 Year Overview *****************************
  3547.  
  3548. Well it is now Jan 6th, 1998.  I have been coding on Chaos for 1 year now.
  3549.  
  3550. We have acheived quite a lot during this time:
  3551.  
  3552. 1) Numerous bug fixes
  3553. 2) Numerous new features
  3554. 3) Numerous new spells
  3555. 4) Numerous code optimizations
  3556. 5) I ended up adding over 256K of asm source to the game, quite a bit more
  3557.    than I originally planned, with lots more on the drawing board.
  3558.  
  3559. The readme file of all the improvements is over 158K
  3560.  
  3561. I noticed back in October, 1997 that my C coding speed had noticeably
  3562. increased to the point that I could code in C just as well as asm.
  3563.  
  3564. There is still an AWFUL lot more work to do, but all in all it has been a
  3565. year filled with great achievments.  Keep up the good work.
  3566.  
  3567. *************************************************************************
  3568.  
  3569. JC: ReleaseSemaphore
  3570.  
  3571.  
  3572.  
  3573. Chaos readme (cont.)
  3574. ====================
  3575.  
  3576. This file continues Readme.1997
  3577.  
  3578. BEGIN: Chaos 2.2
  3579.  
  3580. SAI: Xmas report extracts follow
  3581.  
  3582. There are numerous bugs that we discovered. Some of them are to
  3583. be expected, some you will already know about, others are probably
  3584. better fixed by me. However, I'll list them all down along with
  3585. some other comments.
  3586.  
  3587. * The spell selection by computer players was notably slower on the
  3588.   A500 (this is your new regime of spell selection). However, the
  3589.   real problem here was that there was not enough on screen indication
  3590.   of what was happening. NOW FIXED
  3591.  
  3592. * Somehow there was a sleeping neo-otuygh which was not redrawn.
  3593. * Somehow there was a sleeping ogre-mage that was still animated.
  3594. * Blob grows over earthquake, not sure if I like this or not.
  3595. * The team scores were still not correctly sorted.
  3596.  
  3597. * Several times players shot there own "hidden horrors" to reveal
  3598.   the red dragon. I think the probability of the hidden horror needs
  3599.   to be reduced below that of the red dragon. NOW FIXED
  3600.  
  3601. * The game locks up on the A500 when starting a new game after the
  3602.   completion on the previous game. The only seems to happen when there
  3603.   are lots of wizards. It can also be avoided by starting a new game
  3604.   from the menu before the game ends naturally. I am assuming that this
  3605.   situation is because memory is tight. NOW FIXED
  3606.  
  3607. BUGS:
  3608.  
  3609. * The teleport explode effect is applied to the wrong player. NOW FIXED
  3610. * The boil explode effect is applied to fire rather than water. NOW FIXED
  3611. * The initial set up was the same every time the program was loaded. NOW FIXED
  3612. * If you set the number of turns to "n" you actually get "n+1" turns. NOW FIXED
  3613. * Computer wizards and not conforming to the rules regarding the
  3614.   necropotence spell and discard spell. NOW FIXED
  3615. * Cast agents have an off by one error. Best seen by the Faun casting
  3616.   sleep on his own side. This is probably an improper wizards[]
  3617.   reference. NOW FIXED
  3618. * Dad pressed the end-turn gadget in an attempt to cancel a spell. Instead
  3619.   it tried to cast the creature to some location off the bottom of the
  3620.   screen. NOW FIXED (end of turn ghosted during casting)
  3621. * There is insufficient information given to the player indicating
  3622.   the pick up of a scroll. NOW FIXED (there is a text message and
  3623.   an audio effect)
  3624. * Casting Biohazard gave all scrolls recovery -1 and they subsequently
  3625.   all died in the next round. NOW ALLEGEDLY FIXED
  3626. * Flying creatures still show wings cursor even when engaged. NOW FIXED
  3627. * I cast a Meddle causing the nightmare I was mounted to become a skeleton
  3628.   (i.e. I should now have been mounted on a skeleton); but when I moved the
  3629.   skeleton my wizard was not moved. I think this means I need to check the
  3630.   "mounted" bit carefully when doing reincarnation. ALLEGEDLY FIXED
  3631.  
  3632. * There was a radioactive land scroll. Human players creatures died on
  3633.   trying to enter that cell (which is what is supposed to happen with
  3634.   radioactive land), however, an independent crocodile merely walked
  3635.   onto it. I've yet to check if they are immune from radioactive land
  3636.   in more general circumstances. VERIFIED THIS PROBLEM IS MORE GENERAL
  3637.   THAN I HAD ORIGINAL THOUGHT. Also affects pits. I'm leaving this for
  3638.   the moment pending a bigger revision of computer movement to allow for
  3639.   "eats" and "loathes" and the option of not moving at all.
  3640.  
  3641. * After high-lighting all your creations you need to click end-of-turn
  3642.   twice if you decide to end while high-lighted. This can happen quite
  3643.   often if you just want to check you have moved everything before ending
  3644.   your turn. THIS DIDN'T HAPPEN ON MY COMPUTER -- DID YOU FIX THIS?
  3645.  
  3646. COMMENTS:
  3647.  
  3648. * Callum suggested the horn on the Abath should swing.
  3649.  
  3650. * Glen pointed out that the archery spell description does not actually
  3651.   say what the spell does, although he guessed correctly.  NOW FIXED.
  3652.  
  3653. * Computer players seem to make excessive use of Justice type spells
  3654.   early in the game, leaving them short on powerful spells later in
  3655.   the game. We often found ourselves holding back our styrong creatures
  3656.   for the first five rounds until the computer players exhausted there
  3657.   supply of justice spells.
  3658.  
  3659. * Computer wizard no longer casts castles close to wizard. (I originally
  3660.   had code forcing wizards to cast castles adjacent to the wizards, but
  3661.   I guess you deleted that in making the routines the same -- perhaps
  3662.   we need to build a little more intelligence here).
  3663. --JC Reply: I didn't delete the code.  It was still there all this time;
  3664. it just no longer had any effect in the new system.  All has been FIXED
  3665. now. 8)
  3666.  
  3667. * Computer wizards make no attempt to collect scrolls (to the extent
  3668.   that they will even get off a scroll if already standing on one).
  3669.  
  3670. * Glen wanted scrolls to appear slowly (something like one a turn,
  3671.   rather than having them all on the screen at the outset).
  3672.  
  3673. * Callum wanted "RETURN" to mean end-of-turn. NOW FIXED
  3674.  
  3675. * Callum wanted a key exit from the info panels, he would most like
  3676.   "q" to start the panel, and then another "q" to exit from it.
  3677.  
  3678. * Callum suggested the right hand set of bars on the info pages be
  3679.   labelled "Recovery" at the top. NOW FIXED
  3680.  
  3681. * Dad didn't like the way that "Abduction" chose growths rather than
  3682.   real creatures.
  3683.  
  3684. More changes:
  3685.  
  3686. * Fixed a bug with Repulsion which could leave the colours permanently
  3687.   screwed up.
  3688. * Made isStupidCast compliant with agent casting.
  3689. * Made menu option for script font on info screens.
  3690. * Made menu option for agent casting.
  3691.  
  3692. ========= Beginning of computer movement upgrade =========
  3693.  
  3694. Phase 1: Elimination of GetPlainWeight in cmove.tex.
  3695.   The function GetPlainWeight is a major bottleneck in the calculation
  3696.   of computer movement since it is called approx. 8n times for each
  3697.   creature to be moved where n is the board size, flying movement
  3698.   requires considerable more calls than this. Further, in a previous
  3699.   effort to improve speed this is *really* only done once for each
  3700.   player per turn, but the games plays better if it is done properly;
  3701.   and this is the only way to implement "eats" and "loathes" properly.
  3702.  
  3703.   A quick look at GetPlainWeight reveals that despite the large number
  3704.   of conditionals most objects return a unique value. There I have
  3705.   added a new tag "Weight" to the spell manager to store the values that
  3706.   this function should return. If the tag is not given for a particular
  3707.   spell, then its value defaults to "Life" as indicated by the function
  3708.   GetPlainWeight. I have already added the tag to the appropriate spell
  3709.   files. Another benefit is we will be able to modify behavious on a
  3710.   level by level basis and have much finer control over computer movement
  3711.   than was previously possible.
  3712.  
  3713.   Well on the subject of crude approximation, note that the current
  3714.   flying movement only considers ranges of one of the creature's
  3715.   maximum (in the past it has been far too slow to do this properly!)
  3716.   YEP, IT USED TO BE WAY TOO SLOW DOING THIS PROPERLY.
  3717.  
  3718.   Also due to an oversight it is impossible for a computer controlled
  3719.   creature to decide not to move if already well positioned.
  3720.  
  3721.   The majority of GetPlainWeight can now be eliminated. Hence it is
  3722.   better inlined inside CalculateWeights. Hence GetPlainWeight is now
  3723.   completely deprecated and has been deleted.
  3724.  
  3725.   Note that the corresponding function GetWizardWeight is called a maximum
  3726.   of about 64 times in a round and hence is not at this time worth
  3727.   modification. I think we can tolerate a slight delay in the movement of
  3728.   wizards, they are after all supposed to be erudite fellows.
  3729.  
  3730. The above has taken care of all the checks except isDead, isAsleep, and
  3731. isTOwned. By modifying some basic functions in core.tex the isDead and
  3732. isAsleep checks can also be eliminated. Thus, the only problematic case
  3733. is isTOwned and since the same table of numbers must be used by all players
  3734. there is no way of circumventing this difficulty. However, we have suceeded
  3735. in reducing 7 conditionals (some with complicated predicates) to a single
  3736. conditional and a table lookup. However, this will eventually increase by
  3737. two conditions when "eats" and "loathes" are implemented.
  3738.  
  3739. Since CalculateWeights was only used in one place and there is no longer
  3740. any advantage in its precomputation I have eliminated it. This is made it
  3741. much easier to implement "eats" and "loathes".
  3742.  
  3743. Two constants control the strength of the "eats" and "loathes" effect and
  3744. these may need to be fiddled with to find nice values. The loathing effect
  3745. is in theory strong enough that a creature would prefer to jump into a pit
  3746. or walk on radioactives (but of course in practice a creature would just
  3747. sidle away from both).
  3748.  
  3749. Stopped the computer from moved onto nuked squares. Allowed computer
  3750. creatures to decide the best option is not to move.
  3751.  
  3752. Computer wizards now move towards and stay on scrolls.
  3753.  
  3754. ============== end of computer movement upgrade ================
  3755.  
  3756. * Added Turns, Dread Elf, Dagger, Gravity, Demonic Touch
  3757. * Added secret power up WoodElf->DreadElf (make 5 kills with wood elf)
  3758. * Added gravity to information display.
  3759. * Fixed FileIO to save gravity information.
  3760. * Changed [] in print statements to () (to work with script font)
  3761. * Classic mode no longer default mode for DEVELOPER
  3762. * Fixed end-of-game bug that caused lockups. Still haven't fixed
  3763.   the quit bug.
  3764. * Allegedly completed implementation of Volcano.
  3765. * Added two new generators: one for birds, one for dragons.
  3766. * Improved the loading and saving of the probability table.
  3767. * FIXED at last the ReleaseSemaphore problem when quiting the game.
  3768. * Improved Spell Manager documentation.
  3769. * Modified InsertCreature to handle player=ASLEEP properly.
  3770. * Made fake wizards actually capable of spell casting.
  3771. * Allowed combat on movement rating (see Arctic Wolf).
  3772. * Added: Arctic Wolf, Virtue, Shadow City, Basilisk, Achiyalabopa,
  3773.   and Paradigm Shift.
  3774. * Added function AddSpecificSpell() to spell.tex (thus you can
  3775.   now give a player a particular spell when desired).
  3776. * Added noddy basic program "sayer" to archive.
  3777. * Made <RETURN> equivalent to end-of-turn. Problem: holding down return
  3778.   will cause multiple player to have end-of-turn. To overcome this I
  3779.   have put in a delay, but this is a rather weak solution. If only there
  3780.   was a RAWKEYUP IDCMP event this would be easy to fix, but I couldn't
  3781.   find anything in the docs about doing this.
  3782. * Replaced $ in chaos.font with a bullet.
  3783. * Improved the image for the Nuke spell.
  3784. * Improved the image for the Lightning spell.
  3785. * Stopped display of Nothing spells.
  3786. * Added: Animate, Ball Lightning, Shocker, Basalt Golem, Emerald Dragon,
  3787.   Willy, Glass, Battle Cry, Coercion, Confidence, Eye for an Eye,
  3788.   Torment, and Materialize.
  3789. * Made the secret powerup GreenDragon->EmeraldDragon.
  3790. * Implemented Eye-for-an-Eye in combat routines.
  3791. * Changed io.tex to take account of changes in Wizards structure.
  3792. * Changed info.tex to display new powerups.
  3793. * Fixed a small problem in the intro sequence where "Wizards" and "Webs"
  3794.   were printed multiple times.
  3795. * Made the lmkfile say "Compilation Complete" at the end, so I can do
  3796.   something else while waiting for a recompile.
  3797. * Made a small change to BoardNormalize for speed.
  3798. * Moved multiplicity information from cast.tex into the spell files using a
  3799.   new tag multiplicity. While I was at it, I increased Strong Wall from two
  3800.   pieces to three pieces, and made Slow and Speed each give three attempts
  3801.   (in an attempt to make these spells more useful).
  3802. * Added "bullet.gif" to archive.
  3803. * Modified the Spell Manager to also produce a HTML WWW page detailing
  3804.   all the spells with an index at the top. This means I can now easily
  3805.   browse the spells on my PC.
  3806. * Added new powerups for creatures making high numbers of kills (in the
  3807.   form of specific bonus spells).
  3808. * Devastation spell now correctly awards points.
  3809. * Added casting contraints to computer spell selection for new spells.
  3810. * Moved the foes vanquished display onto the first info screen.
  3811.  
  3812. ============= start of editor upgrade =========================
  3813.  
  3814. * Added ALT-o menu-like system to editor.
  3815. * Added editor support for artifacts.
  3816. * Stopped insertion of objects belonging to player 0 (other than artifacts)
  3817. * Better support for inserting wizards.
  3818. * Can toggle undead status using "u" key.
  3819. * Undead status shown with a red tick at top of cell.
  3820. * Fixed a ClearBoard/Vanquish/ALT-o edit clash.
  3821.  
  3822. ============= end of editor upgrade ===========================
  3823.  
  3824. * Replaced the reqtools with a file requester of my own making.
  3825.   It is pretty slack at the moment, but at least we can get rid
  3826.   of reqtools now. This is good for three reasons: (i) less
  3827.   effort for uses (don't need to install reqtools), (ii) smaller
  3828.   overall memory requirement for game, (iii) no negotiation 
  3829.   needed with reqtools author for a commercial release.
  3830.  
  3831. * Tidied up prog.tex documentation, particularly near the top.
  3832.   Added a small ancient history section.
  3833.  
  3834. * Allegedly reduced the likelihood of computer creatures shooting
  3835.   wizards protected with invulnerability.
  3836.  
  3837. * I made a bootable disk but for some reason the topaz font was
  3838.   different and had wider width than normal when I started this
  3839.   game. As a consequence some of the set-up screen were not
  3840.   quite right.
  3841. -JC reply: You forgot to have an 80 column system-configuration file in
  3842. your devs/ dir.  If this is missing then the OS defaults to a 60 column
  3843. topaz.
  3844.  
  3845.  
  3846. * If the level now increases above 5, then new spells (and the
  3847.   initial spell list in the case of computer wizards) will be
  3848.   composed mainly of unique spells.
  3849.  
  3850. * Added FLAG_SINGLE to computer assistance flags and increased the
  3851.   assistance array to work from BowID onwards. FLAG_SINGLE in now
  3852.   set for spell which should NOT be cast with double or triple
  3853.   active.
  3854.  
  3855. * Converted the Intelligence stat from 3 bits to 4 bits and modified
  3856.   all spell files, info.tex, and cast.tex accordingly. If we made
  3857.   .MR 4 bits most stats would then be the same, but the MR case would
  3858.   be a lot harder to do than Intel was.
  3859.  
  3860. * Added FLAG_NOWIZARDCELL to the computer assistance flags, to
  3861.   indicate spells not to be applied to cells containing a wizard
  3862.   even if the wizard is mounted or meditating (e.g. Alter Reality).
  3863.  
  3864. * Creatures killing their favourite food now get a combat and
  3865.   recovery rate boost.
  3866.  
  3867.  
  3868. ObtainSemaphore (James Conwell) April 1, 1998  Begin Version 2.3
  3869.  
  3870. * Made a small change to the makechaos file so that it would work ok.
  3871.  
  3872. Upon first compiling the game from a fresh dir using smake unarchive there
  3873. is no rein.h file present so therefore reincalc cannot compile therefore
  3874. when the makefile attempts to run reincalc it simply isn't there and
  3875. doesn't run it.  The makefile then continues on its merry way.  I assume
  3876. this means that critical information is not being compiled into the game
  3877. regarding reincarnation.  As this is the domain of SAI I am leaving this
  3878. for him to fix. NOW FIXED
  3879.  
  3880. * I converted my new game musics which I did months ago into protracker
  3881.   format so they could be played by Chaos but 2 of the musics wouldn't
  3882.   convert correctly due to using more than 31 instruments.  And another
  3883.   converted ok but sounds a bit off (Maybe its just my imagination).  In
  3884.   any case I will have to now add OctaMed support to music.lib in order to
  3885.   play all the new music.  I anticipate this will add several K to the code
  3886.   size.  I guess I won't bother adding this until after the 1 meg version
  3887.   is finalized.
  3888.  
  3889. * BUG: Computer wizards refused to cast Magic Bow if they had double or
  3890.   triple in effect.  Bows and swords are cumulative so it is desirable to
  3891.   cast them with triple.  NOW FIXED by removing CAST_SINGLE from bow.spl.
  3892.  
  3893. * EDITED spell descriptions: Gray Elf, Willy, Arctic Wolf, Gravity, Virtue
  3894.   (btw: why is this spell called Virtue?), Paradigm Shift, Ball Lightning,
  3895.   Emerald Dragon, Battle Cry, Coercion (shouldn't this be called mind blank
  3896.   or something?), Materialize, Meddle.
  3897.  
  3898. * NOTICED: I noticed that some of the spell descriptions have been rewritten
  3899.   to be more succinct.  I like this.
  3900.  
  3901. * BUG: Now that you have shifted the info screen, the stat-highlighting is
  3902.   off since it wasn't shifted to match.  The hotspot was off too. NOW FIXED.
  3903.  
  3904. * BUG: Magic Glass doesn't say "Blocks LOS Enemy Only" on 2nd info screen.
  3905.      FIXED.
  3906.  
  3907. * BUG: a dragon just shot my wizard through a magic glass.  The "l" key shows
  3908.   that the dragon does not have line of sight to my wizard yet he shot him
  3909.   anyway.  The shooting routine (at least for independents) must not be
  3910.   taking into account Line of Sight rules 100%.  The problem turned out to be
  3911.   that the shooting code was checking for LOS like this:
  3912.    if (!isLineOfSight(cell,c) continue;  when it actually is supposed to be:
  3913.    if (!isLineOfSight(c,cell) continue;  FIXED.
  3914.  
  3915. BUG: I saved my game a little while ago with some Magic Glasses on the
  3916. board and now that I reloaded it I find that the reloaded game does not in
  3917. any way resemble the game that I saved.
  3918.  
  3919. BUGS: The filerequester sometimes never goes away.  Sometimes it says it
  3920. loads a game but doesn't redraw the gameboard.
  3921.  
  3922.  
  3923. * CHANGED: Dagger -> Poison Dagger
  3924. * CHANGED: Basilisk ranged weapon to attack movement rating. (Basilisks are
  3925.   supposed to paralyze with their gaze. 8)
  3926.  
  3927. * FLAW: Clicking on Ranged Combat on Info screen of Basilisk or Arctic Wolf
  3928.   does not highlight "Movement" so that you can see that they attack
  3929.   Movement instead of life. FIXED.
  3930.  
  3931. File requester doesn't even have a cancel button or any way of navigating
  3932. dirs.  One time I quit the game and the requester screen was left up even
  3933. after the game had terminated.  In fact, it is still up now, hours later.
  3934. FREAKINDICULAR!!!!!  I just went back to look at it and uhhh... it has
  3935. become exactly like the main game screen!!!!  It looks just like the game
  3936. board!!!!  And it is animated too!!!!  All the creatures are in the same
  3937. place!!!!  WOW!!!!  Holy cowabunga!
  3938. Now I quit the game and the ghost screen has gone blank again like it was
  3939. before I started!  How is this possible???  The ghost screen is still up,
  3940. just completely black.  weirdness...
  3941.  
  3942. The only way this is possible is that both screens were pointing to the
  3943. exact same area of memory.  So each "screen" was simply a different window
  3944. onto the same area of memory.  Mystery solved.
  3945.  
  3946.  
  3947. * Implemented req.library file requester into the game.
  3948.   I've been planning to do this for ages but never had time before.
  3949.   This has the following advantages:
  3950.   1. Easy to use.
  3951.   2. Features high-speed smooth scrolling.
  3952.   3. Features powerful pattern-matching.
  3953.   4. Features directory caching. (YAY!!!!)
  3954.   5. I've been using it for years and it is perfectly reliable.
  3955.   6. No negotiation needed to use it in our products.
  3956.   7. Only 18436 bytes in size.  That's 27,700 bytes smaller than
  3957.      reqtools.library and 22,508 bytes smaller than asl.library.
  3958.  
  3959.  
  3960. STRUCTURE COLLISION!  reqbase.h defines a "FileRequester" structure but so
  3961. does the new asl.h   I am renaming the structure in reqbase.h to be
  3962. "FileRequesterStructure".  Hopefully that will fix everything. 
  3963. reqproto.h modified appropriately.
  3964.  
  3965. I copied the following files:
  3966. copy reqproto.h to include:proto/ clone
  3967. copy reqbase.h  to include:libraries/ clone
  3968. copy req.library to libs: clone
  3969. copy lreqglue.o to lib: clone
  3970.  
  3971. The LoadGame function causes 3 enforcer hits while reading block W.
  3972. Well... now the problem seems to have mysterously vanished.  ??
  3973.  
  3974. I fiddled around with the colors of the requester but never found any
  3975. that I really liked.  I'll leave the selection of colors to whoever wants
  3976. to do it.  I'd like the window border to be dark blue but I don't know
  3977. how to do that.
  3978.  
  3979. PROBLEM: After I've played Chaos for several hours and I'm really tired
  3980. I sometimes select load when I meant to select save.  Sometimes I select
  3981. save when I meant to select load with disasterous results.  Sometimes
  3982. this happens due to tiredness and sometimes due to a less than 100% 
  3983. Right Mouse Button.  So I made the load and save screens noticeably
  3984. different.  PROBLEM SOLVED.
  3985.  
  3986. * PROBLEM, after selecting save then cancel the text at the bottom of the
  3987.   screen is erased so you can't tell whose turn it is. FIXED.
  3988.  
  3989. * NEW FUNCTION VerticalWriteText
  3990.  
  3991. ---------- Resumption of Efficiency Upgrade Speed/Memory -------
  3992. Chaos is currently
  3993.   1288456 / 342808 bytes in size.
  3994.  
  3995. * Edited cmove.tex:
  3996.   1259496 / 342640 Saved  168 bytes in GetWizardWeight
  3997.   1259448 / 342568 Saved   72 bytes in EngageChoice
  3998.   1259432 / 342500 Saved   68 bytes in cMoveEngaged
  3999.   1259360 / 342364 Saved  136 bytes in cMoveNonEngaged
  4000.   1259232 / 342212 Saved  152 bytes in MoveAutomaticallly
  4001.   1259224 / 342180 Saved   32 bytes in cShootScore
  4002.   1259236 / 342140 Saved   40 bytes in cShoot
  4003.   TOTAL SAVED cmove.tex   668 bytes.
  4004.  
  4005. * BUG: Computer controlled archers refuse to shoot things that they don't
  4006.   have Line-of-Sight to.  In other words, computer creatures which have
  4007.   archery ability are never actually _using_ their archery ability. 
  4008.   NOW FIXED.
  4009.  
  4010. * CHANGED: Bolter to have 0 Combat. (Since they can't attack anyway.)
  4011. * CHANGED: Magic Glass to not need line of sight when casting it.  And it
  4012.   can now be cast on corpses too.
  4013.  
  4014. Chaos is currently
  4015.   1316936 / 342152 bytes in size.
  4016.  
  4017. * Edited move.tex:
  4018.   1288092 / 342104 Saved   48 bytes in isEngaged
  4019.   1287028 / 340904 Saved 1200 bytes in Combat
  4020.   1287016 / 340848 Saved   56 bytes in MoveEverybody
  4021.   1286920 / 340640 Saved  208 bytes in SpecialCombatHandler
  4022.   1286812 / 340500 Saved  140 bytes in MoveTempest
  4023.   1286580 / 340212 Saved  288 bytes in Growth
  4024.   1286572 / 340180 Saved   32 bytes in SelectCreature
  4025.   1286584 / 340168 Saved   12 bytes in SayCreatureName
  4026.   1286532 / 340088 Saved   80 bytes in GetNewCell
  4027.   1286184 / 339712 Saved  376 bytes in CrMove1
  4028.   1286160 / 339596 Saved  116 bytes in DoShooting
  4029.   1286164 / 339576 Saved   20 bytes in CrShoot
  4030.   1286136 / 339524 Saved   52 bytes in Killed (Standard Editing)
  4031.   1286096 / 339472 Saved   52 bytes in Killed (Replaced 7 occurences of van_count[loc] with *van_countp)
  4032.   1286108 / 339380 Saved   92 bytes in CanGrow
  4033.   TOTAL SAVED move.tex   2772 bytes
  4034.  
  4035. ******** Memory Efficiency Upgrade COMPLETED (finally) ****************
  4036.  
  4037.  
  4038. * FLAW: After clicking on a flying creature the really cool mouse reporting
  4039.   is turned off so you can't automatically know what your mouse pointer is
  4040.   over.  FIXED.
  4041.  
  4042. * FLAW: After clicking on a ground creature the really cool mouse reporting
  4043.   is sometimes turned off so you can't automatically know what your mouse
  4044.   pointer is over.  FIXED.
  4045.  
  4046. * CHANGED: Inanimate objects are no longer highlighted in the color cycling
  4047.   color when you press the number keys.  Technically, it was correct to
  4048.   highlight them with the color cycling color since their moved bit was not
  4049.   set but since you cannot move inanimate objects or even click on them I
  4050.   decided it was best to have them highlighted like other objects which can't
  4051.   currently be moved (in red). Ditto for growths.
  4052.  
  4053. * CHANGED: Speed spell gives 2 attempts instead of 3.
  4054.  
  4055.  
  4056. ***** BONUS SPELL SELECTION UPGRADE *****
  4057.  
  4058. * Upgraded Bonus spell selection so that you can see what you did to earn
  4059.   the bonus spells.
  4060.  
  4061. * Edited bonus.tex
  4062. * Edited cast.tex
  4063. * Edited prog.tex
  4064. * Edited move.tex
  4065. * Edited all relevant spell files
  4066.  
  4067. * All appropriate code sequences now replaced with a call to the new
  4068.   AwardBonusSpell function.
  4069.  
  4070. * Edited init.tex to initialize the new info properly.
  4071. * Edited io.tex to properly load and save the new info.
  4072.  
  4073. ***** BONUS SPELL SELECTION UPGRADE COMPLETE *****
  4074.  
  4075.  
  4076. * BUG: Pyrotechnics wasn't awarding bonus spells based upon what it killed.
  4077.   It was always awarding the number of bonus spells associated with killing
  4078.   wizards rather than the creature actually killed. FIXED.
  4079.  
  4080. * BUG: Pyrotechnics wasn't awarding points based upon what it killed.
  4081.   It was always awarding the number of points of a wizard's initial life
  4082.   rather than the number of points of initial life of the creature killed.
  4083.   FIXED.
  4084.  
  4085. * CHECKED Storm for the same bug as Pyrotechnics, but it checked out ok
  4086.   with no bugs found.
  4087.  
  4088. * Fixed Team score sorting bug.  The problem was that the scores were being
  4089.   calculated based on team numbers but displayed based on player numbers.
  4090.   It needed to be calculated and displayed based on one or the other.
  4091.   NOW FIXED.
  4092.  
  4093. * BUG: Computer players are casting Magic Castles and Dark Citadels far
  4094.   away from themselves.  FIXED. (This was considered stupid so I just
  4095.   modified isStupidCast to detect this.)
  4096.  
  4097. * CONFUSING: The display of the Team Icon on a Wizard's info screen
  4098.   display. This is no longer needed due to the improved number keys + Team
  4099.   Score display. REMOVED.
  4100.  
  4101. * q key now quits from info panels any other key continues on just like a
  4102.   LMB (Left Mouse Button) press.  Now using the q key RAWKS!
  4103.  
  4104. * BUG: At one point in the music, the lowest note of spectrogram 3 is
  4105.   showing up as the highest note of spectrogram 2.
  4106.   Made a simple 1 channel mod that plays notes from lowest to highest
  4107.   and watched it on my scopes to see if it played correctly.
  4108.   WOAH!  All this time my spectrograms were significantly off!  
  4109.   Spectrogram 1 was ok but spectrogram 2 was off by 4 bytes and spectrogram 3
  4110.   was off by 8 bytes and spectrogram 4 was off by 12 bytes!
  4111.   So basically you just couldn't see the lowest notes in the display.
  4112.   ALL FIXED NOW.
  4113.  
  4114. * REMOVED all support for Oktalyzer music since the Oktalyzer replay code
  4115.   in music.lib was bugged and couldn't play my >64k samples and since I
  4116.   only had 1 ChaosTheme song that was 8 channels anyway and since I am about
  4117.   to finalize the "final" 1 meg version of the game.
  4118.   Removed over 50k of assembler source code.
  4119.   music.lib reduced in size from 34780 -> 24112 saved 10668 bytes.
  4120.   This reduced the executable filesize by 14108 bytes.
  4121.   I figure we can better use that 14k for other things right now.
  4122.  
  4123. * Implemented "Instrument Flashing" into Music.lib asm code.  This allows
  4124.   us to detect and do something anytime a particular instrument in the music
  4125.   is played.  Its primary purpose is to allow us to animate something to
  4126.   the beat of the music. (The quadrascope and spectrograms work by channels
  4127.   not by instruments.)
  4128.  
  4129. * Implemented monster dancing for song 1. I finally got "Instruemnt Flashing"
  4130.   working for Monster Dancing but now I see that the OS DrawImage routine is
  4131.   soooooo ridiculously slow that I can't even have *1* monster dancing on a
  4132.   25 Mhz 030 without it screwing up and slowing down my jcquadragram.  And
  4133.   on the 7Mhz 000 it looks atrociously bad. 8(  So I am leaving the code
  4134.   intact just not "activating" it until someday when I have time to
  4135.   integrate my new asm gfx routines which are a zillion or two times faster.
  4136.   Oh well, at least I can see that the concept will look fairly kewl.
  4137.  
  4138.   Or we could just convert a few Monster Images from DrawImage format into
  4139.   Sprite format and then just animate the sprites.  That would be vastly
  4140.   faster and would work on any Amiga right now.  Does anyone want to do
  4141.   this?
  4142.  
  4143. * BUG: Selecting QUIT from setup screen I or II causes the game to crash.
  4144.   FIXED by commenting out the code for the QUIT and LOAD gadgets.  This was
  4145.   the easiest and fastest way to fix this problem and it makes the program
  4146.   simpler and easier to understand since now the ONLY way to quit or load the
  4147.   game is from the dropdown menu in the main game.
  4148.   I left all the gadget code intact in init.tex in case you
  4149.   want to use it / fix it in the future. I'm just in a hurry to get the final
  4150.   A500 1 meg, no HD version done at the moment.
  4151.  
  4152. * IMPROVED ChaosDocs.tex a bit.
  4153.  
  4154. ******************* Editor Upgrade *****************
  4155.  
  4156. * FIXED warnings about no prototypes in editor.tex.
  4157. * FIXED the flaw where it still said you were in the editor after you had
  4158.   quit the editor.
  4159.  
  4160. * PROBLEM: I can't tell what my mouse pointer is pointing at when using the
  4161.   level editor because the really cool auto-mouse-reporting feature isn't
  4162.   there 8(.  I just LOVE always knowing exactly what I'm pointing at
  4163.   because A) Some creatures look just alike and B) I don't remember what
  4164.   every spell looks like.  Indeed, this is the main reason I liked using my
  4165.   mini-level editor; I always knew exactly what I was looking at because the
  4166.   computer always automatically told me, no guesswork involved.
  4167.   SOLUTION: I put in auto-mouse-reporting code into editor.tex. YAY!!! 
  4168.  
  4169. * ShiftKeyIsBeingPressed is now a global variable.
  4170. * Enabled keypresses in Main Level Editor.
  4171.   Made several routines:
  4172.   KeypressNumeric(); // Show all creatures on your team.
  4173.   KeypressL(); // Line of Sight
  4174.   KeypressM(); // Move
  4175.   KeypressR(); // Range of shooting weapon
  4176.   KeypressS(); // Shoot (Things you can actually shoot)
  4177.  
  4178. * FIXED the top level of Alt-o menu system to print the name of the actual
  4179.   category that you are pointing at.  (I had always intended my alt-o mini
  4180.   editor to do this but just never got around to it.)
  4181.  
  4182. * Enabled Keypresses even during the Alt-O menus.  Now when you have a list
  4183.   of undead creatures sitting in front of you and you want to pick one that
  4184.   is tough but has a low recovery rate you just press q on each one and look,
  4185.   _then_ you pick the exact one you really want with your mouse. Nifty.
  4186.  
  4187. * This also was a good excuse for me to clean up the HandleIDCMP code a bit.
  4188.  
  4189. * Now the official level editor is good enough that I can quit using my
  4190.   mini-level editor!  In fact, I seriously considered deleting my
  4191.   mini-editor from the source code but I refrained from doing so because
  4192.   once I start implementing a future gigantic, complicated upgrade there may
  4193.   be a period of time during the transition where the official level editor
  4194.   stops working. During such a time I can still use my editor to throw
  4195.   monsters on the screen and test new gfx routines and stuff.
  4196.  
  4197. * New Predicates: isIDspecialcombat, isIDweirdattacker, isIDcastfree
  4198.  
  4199. * New classes of creatures such as "Flying Shooters"
  4200.   "All creatures with weird attacks", "All creatures with special combat",
  4201.   "CAST_FREE Scrolls" and "Spells that require a target".
  4202.  
  4203. * Completely rewrote Info.tex to use pointers to Cell Structures rather
  4204.   than copies of Cell structures.
  4205.   1. This allows the usage of our standard IsDead, IsUndead, IsCloaked and
  4206.      IsScroll macros instead of all that char_stat.stat & XXXX_STAT code;
  4207.      thus making the code a bit easier to read.
  4208.   2. I had to do it so that the level editing code in info.tex could
  4209.      actually change the values of stats.
  4210.   3. Doing this + deleting dead code + making optimizations saved 1972
  4211.      bytes on the smake dev code size.
  4212.  
  4213. * Implemented stat-editing on info panels when brought up from within the
  4214.   level editor (LevelEditorActive==YES).
  4215.   Use the mouse to click on the stat and then enter the new stat right on
  4216.   the screen.
  4217.  
  4218. * MODIFIED COMBAT, RANGED COMBAT, SPECIAL COMBAT GADGETS TO HANDLE UP TO 4
  4219.   CHARS. -15(NULL).
  4220.  
  4221. * BUG: Most recovery rate graphs are not being redrawn when clicking on
  4222.   Combat, Ranged Combat or Special Combat to see what they attack. FIXED.
  4223.  
  4224. I couldn't figure out how to control the color of string gadgets... ???
  4225. It doesn't matter right now but it might in the future.
  4226.  
  4227. * Upgraded CheckHotSpot to handle any size of BoundingBox Structure.
  4228.   (Bounding Box Structures are now terminated with {-1,-1,-1,-1}
  4229.  
  4230. * You can now edit attributes on the 2nd info panel.  Just click on a
  4231.   stat to toggle it.
  4232.  
  4233. * Tested making an attacking, flying, shooting, meditation, mountable set 1,
  4234.   creature generator. Hehehehehee HARHARHAR ROFL!!!!  It actually works!
  4235.   I can fly my DragonNest around the screen attacking and shooting things!
  4236.   And I can mount it and dismount it!!!!  And it emits dragons for me even
  4237.   while my wizard is mounted in it!!!! ROFDL!!!!  The game engine gets an
  4238.   A+ for allowing this to work on the first try!
  4239.  
  4240. * I inserted code for editing Move_Recover and Range_Recover stats
  4241.   into info.c.  Just uncomment 2 lines of code and it will work.
  4242.   flashfind from "" search Move_Recover and uncomment all the other
  4243.   lines of code in other modules and all will work fine whenever you
  4244.   add Move_Recover and Range_Recover stats to the game.  I would have
  4245.   went ahead and added them myself but I wasn't sure how to do it anymore
  4246.   with the new system.
  4247.  
  4248. Ok that's it for this upgrade.  I'll leave the editing of names, scores,
  4249. and spell lists to SAI.
  4250.  
  4251. ****************** End Editor Upgrade *****************
  4252.  
  4253. * FIXED those blocks for Range and Move on info panel. Scooted them down 2
  4254.   pixels.
  4255.  
  4256. * MAJOR FLAW: sometimes the speech doesn't work, sometimes it does... it is
  4257.   completely random.  This affects monster names, creature names, player
  4258.   names, everything...
  4259.   Put breakpoints on SayCreatureName, SayName and Say and then play a test
  4260.   game and figure out what the hell is happening...  I just couldn't find any
  4261.   pattern to the failure of the speech.  At first I thought maybe it was an
  4262.   unmatched say/waitforsay pair but after checking through the game for an
  4263.   hour that just wasn't it.  So then I thought maybe some other sound effect
  4264.   was somehow not releasing the audio.device (like maybe the combat sound
  4265.   effect)  But no that just wasn't it either.  Ok, well I finally found the
  4266.   problem in the Say() function:
  4267.     voice_io.pitch                              = 65 + MSGRandom() & 0xFF;
  4268.   Sometimes this sets voice_io.pitch to a very low number like 21 or 28 etc.
  4269.   Values this low produce no sound in the speech system.
  4270.   Changing the offending line to:
  4271.     voice_io.pitch                              = (UWORD)(65 + (UWORD)MSGRandom() & 0x00FF);
  4272.   still doesn't work... Must be changed to:
  4273.     voice_io.pitch                              = (UWORD)65 + ((UWORD)MSGRandom() & (UWORD)0x00FF);
  4274.   NOW COMPLETELY FIXED.
  4275.  
  4276. * Nowhere did it say what type of value MSGRandom returns, not even in its
  4277.   prototype.  NOW FIXED (int)
  4278.   SAI: In C if a prototype does not designate a return type it is assumed to
  4279.   an int. However, it is generally better to define it anyway.
  4280.  
  4281. ??? Creatures with 0 move and 0 manuverability sometimes are not
  4282. engaged to adjacent enemy creatures.  How is that happening?  It used to be
  4283. that 0 manuverability meant you were automatically engaged to any adjacent
  4284. enemy creature.  Did you change this on purpose?  This is fixed months
  4285. later.
  4286.  
  4287. * FIXED: Pressing Amiga-m or Amiga-n on info screens was clearing the info
  4288.   screen because ANY key triggered going to the next info screen. NOW FIXED by
  4289.   simply ignoring all keys except for q=quit and w,a,tab and return take you
  4290.   to the next info panel.
  4291.  
  4292. * Speeded up line of sight testing by about 30% in many cases.  YAY!
  4293.  
  4294. Well, I haven't added any new asm code in over 2 weeks so its about time
  4295. for:
  4296.  
  4297. * Speeded up SqDistance by 5% (eliminated 8 cycles) asm SqDistance is now
  4298.   over 12x as fast as C SqDistance. YAHOO!
  4299.  
  4300. * Speeded up SqDistance again. (Eliminated 4 cycles on 68000.  68030 cycle
  4301.   count unchanged.
  4302.  
  4303. ********* HIGH-SPEED Vector Graphics Upgrade ****************
  4304. *********              PART I                **************** 
  4305.  
  4306. * Implemented hyper fast sin and cos asm functions. (JCSin and JCCos)
  4307.  
  4308.   James Conwell's FAST Trigonometric Functions.
  4309.   =============================================
  4310.  
  4311.   I could never decide what to call these next 2 functions.
  4312.   I could just call them FastSin and FastCos but that would infer that
  4313.   they do the same thing as sin and cos which they DON'T.
  4314.   These functions have less significant digits than the "real" sin and cos.
  4315.   These functions are MUCH faster than the "real" sin and cos.
  4316.   These functions require the input angle to be measured in units of jams,
  4317.   NOT degrees or radians.  1 jam = 1/4096th of a complete circle.
  4318.  
  4319.    512 jams =  45 degrees.
  4320.   1024 jams =  90 degrees.
  4321.   2048 jams = 180 degrees.
  4322.   3072 jams = 270 degrees.
  4323.   4096 jams = 0 jams = 360 degrees = 0 degrees.
  4324.  
  4325.   btw jams stands for "James' Angular Measurement System".  This system
  4326.   fully utilizes the power of binary integer arithmetic inherent in all
  4327.   CPUs.
  4328.  
  4329.   Since the ABSOLUTELY SMALLEST angle that could ever be graphed on a
  4330.   standard Amiga display is 1/640th of a circle, dividing a circle into
  4331.   4096 equal parts should be far more resolution than needed.
  4332.   Furthermore, it would require the use of the entire width of the screen
  4333.   to graph an angle of 1/640th of a circle, so it is unlikely that we would
  4334.   ever need 1/640th of a circle resolution.
  4335.  
  4336.   These functions derive their speed by:
  4337.   1: Using fast lookup tables.
  4338.   2. Using integer multiplication instead of Floating point Multiplication.
  4339.   3. Using perfectly optimized assembly language code.
  4340.      Only 7 instructions for the whole routine! (And 1 of those is RTS)
  4341.  
  4342.   Note that I overlapped the sin and cos tables so that instead of having 2
  4343.   seperate 8k tables I have only one 10k table.
  4344.  
  4345.   The table size could have been greatly reduced by defining a jam to be
  4346.   only 1/2048th or 1 /1024th of a circle.  But I wanted lots of accuracy to
  4347.   be safe. (Some games and demos allegedly get away with a 256 angles per
  4348.   circle system)
  4349.  
  4350.  
  4351.   TIMINGS for Result = Multiplier * Sin(angle)
  4352.  
  4353.   1 frame = 1/50th second.
  4354.  
  4355.   Processor Clock Rate   Method                         Speed
  4356.   68000     7.15905 Mhz  scm.lib (IEEE double)           206 calls/second
  4357.                                                          4.1 calls/frame
  4358.  
  4359.   68000     7.15909 Mhz  mathieeedoubtrans.library       222 calls/second
  4360.                          (IEEE double)                   4.4 calls/frame
  4361.  
  4362.   68000     7.15909 Mhz  mathtrans.library              1282 calls/second
  4363.                          (Motorola Fast Floating Point) 25.6 calls/frame
  4364.  
  4365.   68000     7.15909 Mhz  JCSin asm code                58000 calls/second
  4366.                          (16 bit precision)             1160 calls/frame
  4367.  
  4368.   68030 +
  4369.   68882 FPU 25 Mhz      mathieeedoubtrans.library      13000 calls/second
  4370.                         (IEEE double)                    260 calls/frame
  4371.  
  4372.   68030     25 Mhz      scm.lib (IEEE double)           1190 calls/second
  4373.                                                         23.8 calls/frame
  4374.  
  4375.   68030     25 Mhz      JCSin asm code                232558 calls/second
  4376.                         (16 bit precision)              4651 calls/frame
  4377.  
  4378.   Time to JUST multiply a double * a double using scm.lib:
  4379.   68030     25 Mhz      scm.lib                        24509 calls/second
  4380.                                                          490 calls/frame
  4381.  
  4382.   84 seconds to do 100000 multiplier * sin(angle) with scm.lib
  4383.    4 seconds to do 1000000 JCSin.
  4384.   43 seoonds to do 10 million JCsin
  4385.   408 seconds to do 10 million  scm.lib double * double
  4386.  
  4387.   So as you can see, even if we are doing simple rotation where we can
  4388.   precalculate value*sin(angle) and then just do double * double in the main
  4389.   loop JCSin is 9.49x as fast!
  4390.  
  4391.   JCSin can calculate the sin of a number and multiply it by a value 9.49x
  4392.   as fast as SASC can _just_ multiply two IEEE double numbers together
  4393.   _without_ any sin calculation!
  4394.  
  4395.   At the time of this writing, Chaos (world's best strategy game) is
  4396.   drawing vector graphics to the screen using the "Precalc IEEE double
  4397.   method" whereby the main loop doesn't need to do any slow sin/cos
  4398.   calcualations.  Nevertheless, rewriting that section of code to use JCSin
  4399.   will increase the speed of the math computations by a factor of 9.49!
  4400.  
  4401.   I put off implementing these routines for a long time because at first
  4402.   Chaos had no vector graphics so I decided to delay until I was ready to
  4403.   implement some vector graphics.  But then one day SAI implemented a
  4404.   roatating vector pentagram and I knew then that I would have to move up the
  4405.   day when I implemented these routines.  That day has come.
  4406.   If we are going to have vector graphics in Chaos then dammit! We are
  4407.   going to have vector graphics just as good as everyone else!
  4408.   I want Chaos Vectors to be just as good as Star Wars, Empire Strikes
  4409.   Back, BattleZone, Tempest, etc.  JCSin and JCCos are a solid first step in
  4410.   that direction.  BTW: I _LOVE_ vector graphics!  I've wanted to program
  4411.   animated vector graphics ever since I first saw an ad for an Apple ][
  4412.   circa 1981 that had some sort of graph plotted on the screen.
  4413.   (Of course this blue graph couldn't move at all, but I didn't know that
  4414.   from looking at the advertisement.)
  4415.  
  4416.   LIMITS:
  4417.   sin and cos values have 15 bits of resolution + 1 sign bit.
  4418.   Multiplier inputs are limited to -16383 to +16383.  This should be WAY
  4419.   WAY WAY more than we really need.
  4420.   Final answer contains 15 bits of resolution + 1 sign bit.
  4421.   This should be WAY more than we need for drawing vector graphics and just
  4422.   the right amount for generating 16-bit sound samples.
  4423.   UNITY=32767
  4424.   Smallest angle = 1 jam = 1/4096th of a circle = about .088 degrees
  4425.   It is totally safe to call these functions with large angles.  It
  4426.   automatically takes care of "wrap-around" angles.  So if you need to add
  4427.   angles up to more than 4096 jams then go right ahead.  It can wrap around
  4428.   several times and still work perfectly.  Beyond that is untested.
  4429.  
  4430.   CONVERSIONS:
  4431.   AngleInDegrees = 360 * AngleInJams/4096
  4432.   AngleInRadians = 2 * PI * AngleInJams/4096
  4433.   AngleInJams = 4096 * AngleInDegrees/360
  4434.   AngleInJams = 4096 * AngleInRadians/2*PI
  4435.  
  4436.   HOW DOES THIS WORK?
  4437.   Well, since it seems that sin and cos are always used in conjuction with
  4438.   multiplying by some number and since floating point multiplication is
  4439.   inherently VERY slow I decided to make a system that could use integer
  4440.   WORDS to do the same thing, only faster.
  4441.  
  4442.   You give these functions a multiplier and an angle measured in jams and
  4443.   you get a result of the sin of the angle multiplied by the multiplier.
  4444.  
  4445.   This should allow us to do high-speed vectors with scaling and rotation
  4446.   of any angle and speed we desire.
  4447.  
  4448. ****************  PENTAGRAM VECTOR UPGRADE **************
  4449.  
  4450. All timing tests performed on A3000/030 @25Mhz with all CPU caches on and
  4451. burst mode activated.  Of course I removed the WaitVblank code for this
  4452. timing test so I could find the absolute speed of the code.
  4453.  
  4454. Original MenuAboutUpdate 10,000 times
  4455.  Entire thing         = 90 seconds =  112 calls/sec = 2.2 calls/frame.
  4456.  
  4457. This means that each call takes about .44 of a frame to execute so that if
  4458. the pentagrams were being drawn in the bottom 1/2 of the screen then it
  4459. should theoretically be fast enough to run at 50 fps on 030 with no flicker
  4460. without being optimized.
  4461.  
  4462. In any case the current speed is nowhere near fast enough for the A500.
  4463.  
  4464.  Just the mathematics = 10 seconds = 1000 calls/sec = 20  calls/frame
  4465.  Just the graphics    = 80 seconds =  125 calls/sec = 2.5 calls/frame
  4466.  
  4467.  
  4468. Upgrade Part 1: Changed WriteMask to 0x08
  4469.  Just the graphics    = 20 seconds ( 4x speed increase)
  4470.  
  4471. Upgrade Part 2: Copy the first pentagram with ClipBlit() instead of drawing a whole new one.
  4472.  Just the graphics    = 18 seconds (Very disapointing speed increase 8(
  4473.  
  4474. Upgrade Part 3: Rewrote Mathematics to use JCSin and JCCos
  4475.  Just the mathematics =  1 seconds (10x speed increase)
  4476.  Just the graphics    = 18 seconds
  4477.  Whole Routine        = 18 seconds
  4478.  
  4479. Upgrade Part 4: Disabled ClipRect
  4480.   LoResRastPortClipRect=rastPort->Layer->ClipRect;
  4481.   rastPort->Layer->ClipRect=0;
  4482.   DID NOT WORK. 8(
  4483.  
  4484.   LoResRastPortLayer=rastPort->Layer;
  4485.   rastPort->Layer=0;
  4486.   WORKED!
  4487.  Whole Routine        = 16 seconds (11 % speed increase)
  4488.  
  4489. Upgrade Part 5: OwnBlitter() DisownBlitter()  FAILED.
  4490.   Attempting to surround all the Draw() commands with
  4491.   OwnBlitter()/DisownBlitter() resulted in a machine lockup.
  4492.   OwnBlitter()/DisownBlitter() do NOT nest.  Any task attempting 2
  4493.   OwnBlitter() with no intervening DisownBlitter() will lock up.
  4494.   (I learned this the hard way but it is documented in the RKM)
  4495.  
  4496. Upgrade Part 6: DoubleBuffering.  AVERTED for now.
  4497.   Since the pentagram drawing routine now takes less than .04 of 1 frame
  4498.   to execute this means that if we draw the pentagrams further than .04
  4499.   of a frame down the screen (10.24 pixels) then we don't need to
  4500.   double-buffer it (Referring to time on 25Mhz 030).  Since the pentagrams
  4501.   are currently about 24 pixels down the screen we should be safe, even on
  4502.   the A500.  But be warned that in a period of high-cpu load multitasking
  4503.   the pentagrams might start to flicker due to not being double-buffered.
  4504.   
  4505. I was having a problem that I had anticipated: The pentagram was
  4506. "degrading" after multiplle rotations due to cumulative round-off error.
  4507. So I fixed it by simply having all rotations based upon the ORIGINAL
  4508. cooridinates of the pentagram. Instead of rotating 23 jams each time, I
  4509. have it rotate 23 jams the first time, then 46, then 69 etc. However,
  4510. this brought up a new problem:
  4511.  
  4512. Trying to rotate the object more than 512 jams (45 degrees) at one time
  4513. causes the pentagram to begin shrinking and expanding randomly.  ????
  4514.  
  4515. This problem is being caused by the fact that JCCos is returning wrong (and
  4516. strange) values beyond 45 degrees / 512 jams.  I can't for the life of me
  4517. see what could be wrong.  AFAICT this is caused by a bug in Devpac when
  4518. assembling large tables.  CodeProbe just freaks out and starts lying to me
  4519. about the contents of registers whenever I try to trace through the code.
  4520.  
  4521. * Made numerous changes to AnimatorAsm.s so that the SASC "asm" command
  4522.   could assemble it...  All was going well but there is a bug in SASC 6.5
  4523.   "asm" that prevents it from using binary numbers in the data sections
  4524.   (Which is very strange since binary numbers work fine in the code sections).
  4525.  
  4526. I am very tired now and have other things I must
  4527. work on.  In the meantime I have used the symmetry of the pentagram to work
  4528. around this problem with a little trick.  When the rotation reaches 512
  4529. jams I reset it back to 0 jams and all works fine.
  4530.  
  4531. * Ok I have now proven for a fact that Devpac is NOT assembling AnimatorAsm
  4532.   correctly.  It is not including about 4k of my sin/cos table for
  4533.   some strange reason.  As soon as I upgrade to a new version or switch to a
  4534.   different assembler all will be working fine.
  4535.  
  4536. * Tried inserting numerous fake labels into the asm data so that there would
  4537.   be <1000 bytes of data between labels but this had no effect. My table is
  4538.   STILL not being included in its entirety. 8(
  4539.  
  4540. * Switched the asm source over to use the A68K assembler (This is the
  4541.   assembler that I have been using on music.lib) version 2.71 1991.  It has
  4542.   the EXACT same bug that Devpac 3.14 1994 has!  This is very strange.  I
  4543.   even increased its hash size to 9999 and its heap to 30,000 but this had
  4544.   no effect.
  4545.  
  4546. * Attempting to switch over to ASM-ONE v1.16 1993.  I used to use v1.08B
  4547.   1991 of this assembler a lot years ago because it has the best user
  4548.   interface. Unfortunately it had certain bugs so I eventually stopped.
  4549.   Trying now: It can't handle the @ sign in fuction names.  It can't handle
  4550.   spaces in dc.w statements.  It can't handle local labels (at least not
  4551.   with \)  Giving up on this. 8(
  4552.  
  4553. * BREAKTHROUGH!  Using A68K assembler I have just found that if I remove
  4554.   the 14 blank spaces in my dc.w lines that it then includes an extra 16
  4555.   bytes of my table data!  This means that it _should_ include the whole
  4556.   table if I just eliminate all the blank spaces!
  4557.   Unfortunately it didn't work out quite like that.  It included MOST of the
  4558.   data but not all. 8(
  4559.   VERIFIED that Devpac behaves the EXACT same way.
  4560.   After removing the spaces the filesize from devpac went from 17568 to
  4561.   23088. (It included more of the table data (5520 bytes))
  4562.  
  4563. * FINAL REPORT on Devpac Bug: As far as I can tell, it was only including
  4564.   the FIRST data item on each line. I had 8 data items on each line so only
  4565.   1/8th of the table was really being included.  Thus when I rotated the
  4566.   pentagram 45 degrees I was _really_ rotating it 360 degrees which would
  4567.   explain why it looked so smooth when I reset to 0. This is all AFAIK.
  4568.  
  4569. * Reassembled the code using 1 number per line in the DC.W and now JCSin
  4570.   and JCCos are working perfectly!!!!!! YAHOO!
  4571.  
  4572. * Added some extremely simple 3D rotation to the pentagram.
  4573.  
  4574. ***** END PENTAGRAM UPGRADE ****
  4575. ******** END HIGH-SPEED Vector Graphics Upgrade *************
  4576. ********            END  PART I                 *************
  4577.  
  4578. * Edited asm Getxy to save 2 cycles on 68000.  68030 cycle count unchanged.
  4579. * Edited asm AnimatorAsm to save 6 cycles.
  4580.  
  4581. * Disabled clipping on quadrascopes + quadspectrogram for small speed gain.
  4582.  
  4583. * Time to execute 100,000 DrawImage(FaunID) on 25Mhz 030 + 7Mhz Blitter
  4584.   with clipping enabled  63 seconds
  4585.   with clipping disabled 57 seconds (9.5% faster)
  4586.  
  4587.   Time to execute 100,000 DrawImage(DarkPowerID) (Chosen because it has lots of color) 
  4588.   with clipping enabled  72 seconds (27.7 calls per frame)
  4589.   with clipping disabled 66 seconds (8% faster) 25Mhz 030 + 7Mhz Blitter
  4590.  
  4591.   Time to execute 100,000 DrawImage(DarkPowerID) to an unaligned memory location.
  4592.   with clipping disabled 70 seconds (6% slower) !!!  This means DrawImage
  4593.   is terribly inefficient.  If it was efficient then an unaligned drawing
  4594.   would take 50% longer or more.
  4595.  
  4596.   Time to execute 100,000 "Highlight a cell" on 25Mhz 030 + 7Mhz Blitter
  4597.   with clipping enabled  118 seconds
  4598.   with clipping disabled  97 seconds (19.5% faster)
  4599.  
  4600.   Remember these speed improvements will be much greater on a 68000 because
  4601.   it does math much more slowly and because the blitter is the same speed
  4602.   on both systems.
  4603.  
  4604. * Disabled clipping during the AnimatorTask for about an 8% speed boost on
  4605.   030 (should be at least a 24% speed boost on 68000) The A500 version
  4606.   needs as much speed as possible.  A mysterious blue line has now appeared
  4607.   on the left hand side of the board to mark the edge. ???  I think my
  4608.   Amiga has become sentient and is trying to help me design the game on its
  4609.   own initiative. 8)
  4610.  
  4611. * OOPS! With no clipping, when you are using the drop down menus the
  4612.   animated monsters overwrite them.  Ok, I have sort of fixed this by using
  4613.   the MENUVERIFY feature of the OS.  Unfortunately there are so many
  4614.   different places that handle IDCMP messages now that it is causing a
  4615.   problem.  I have only fixed the main HandleIDCMP routine for now.
  4616.   SAI: This fix is what is causing problems to menus. See later.
  4617.  
  4618. * Ok, I have now modified all those keypresses that highlight cells to
  4619.   temporarily disable the menus.  EVERYTHING IS WORKING PERFECTLY NOW.
  4620.  
  4621. * REMEMBER THIS: The animator Task has proven itself to be safe therefore
  4622.   it is disabling the OS clipping to get a speed boost.  Therefore; we are
  4623.   now using MENUVERIFY so that before any menus are drawn we can stop the
  4624.   animator from running (to keep it from drawing over the menus).  This
  4625.   means any time you are going to parse messages from the IDCMP from "window"
  4626.   You MUST be prepared to deal with this by either correctly handling
  4627.   MENUVERIFY (see HandleIDCMP for an example) or just disable the menus or
  4628.   just turn off the MENUVERIFY feature via ModifyIDCMP();
  4629.   I know this is something of a hassle but this programming technique was
  4630.   going to be neccessary eventually anyway for the day when I put in my
  4631.   asm gfx routines which simply don't know anything about clipping or menus
  4632.   or such things.
  4633.  
  4634. * REMEMBER THIS: Do not ever disable the OS clipping for any routine unless
  4635.   you are ABSOLUTELY sure that it NEVER will EVER write outside the bounds of
  4636.   the rastport.
  4637.  
  4638. * About, New, Quit etc. (things in menu.tex) should get a lock on the board
  4639.   first to keep the animatortask from overwriting the display. FIXED.
  4640.  
  4641. * Changed xpixel[] and ypixel[] arrays to be arrays of UWORDS instead of
  4642.   ints.  UWORDS are faster and take only half the memory of ints. Adjusted
  4643.   C + asm code accordingly.
  4644.  
  4645. * Disabled clipping in DoTheHighlighting() and Highlight() to get the 19.5%
  4646.   speed boost. 
  4647.  
  4648. * BUG: smake release version freaked out on alt-o in official level editor
  4649.   due to backupboard not being allocated.  FIXED.
  4650.  
  4651. * New option: smake demo.  Allows us to manufacture a demo version of the
  4652.   the game with no loading, saving or level editing.
  4653.  
  4654. * #IFDEF all loading and saving code.
  4655.   #IFDEF'ed all calls to LoadInit, SaveGame, LoadGame and LoadLevel.
  4656. * #IFDEF'ed all level editor code.
  4657. * #IFDEF'ed all the file requester code in menu.tex.
  4658. * #IFDEF DEMO a check for turn 20 and quit the game.
  4659. * Removed io.o and editor.o from smake demo linking
  4660.  
  4661. * Attempting to edit, load or save produces the message "Removed from DEMO
  4662.   version.  Please register."
  4663.  
  4664. * CHANGED: The level editor is no longer mentioned anywhere in the docs or
  4665.   the game due to the fact that it isn't completed yet, etc.
  4666.  
  4667. * Solved the mystery of accessing NEAR C variables from asm.
  4668.  
  4669. * Rewrote DoTheHighlighting in asm for a 9.28x speed increase.  I want the
  4670.   game to respond instantly to the player's commands.
  4671.  
  4672. * Old C DoTheHighlighting could only highlight 20.6 cells per frame (and
  4673.   this speed includes the "turn off the clipping" trick.)
  4674.   New Asm DoTheHighlighting always highlights 191.1 cells per frame.
  4675.   9.28x faster!  This should be a full 10x faster on most Amiga systems
  4676.   because most Amigas have their graphics.library in the kickstart ROM but
  4677.   my A3000 loads kickstart into FastRAM.  ROM chips are very slow compared to
  4678.   ram chips. Plus my fastram is compatible with Burst Mode CPU accesses
  4679.   which I don't think any ROM chips support.
  4680.  
  4681. * Rewrote KeypressR() to use DoTheHighlighting(); so it can take advantage
  4682.   of the enhanced speed like the other keypresses.
  4683.  
  4684. * Implemented Lissajous Squares Quit Menu thingy.  I did this for the
  4685.   following reasons:
  4686.   1. I wanted to do a really kewl requester.
  4687.   2. I am vaguely planning to play a different piece of music on each
  4688.      requester in menu.tex; therefore, I need all the requesters to be
  4689.      silent so as not to interfere with the music.
  4690.   3. Amiga color-cycling RULEZ!
  4691.  
  4692.   FEATURES:
  4693.   1. Looks kewl.
  4694.   2. 31 colors are cycled.
  4695.   3. Just when you think it is going to shoot off the screen it arcs around
  4696.      and comes back.
  4697.   4. Fast.
  4698.   5. Smooth.
  4699.   6. Infinite variety. (Only the first one is the same each time, after
  4700.      that they are randomly generated.  Zillions of different designs.)
  4701.   8. Utilizes Asm TestPixel, JCSin and JCCos.
  4702.  
  4703. * We can now turn on/off the color cycling of the lores screen with the
  4704.   variable LoResColorCycling.  e.g. LoResColorCycling=OFF; turns it off.
  4705.  
  4706. * Minor touchups on Setup Screen I
  4707. * Edited description of Reflector.
  4708. * Replaced "New Game" requester with Lissajous Squares version.
  4709.  
  4710. * Monday June 1, 1998 19:01:42 attempting a "smake demo" with stripdebug and
  4711.   optimize. Finished 19:29:13 WOW!  It took less than 30 mins on my 25Mhz
  4712.   030!  The optimizer reduced the max codesize from 305192 to 293044.
  4713.   But the final filesize is 328608.  Hmmm.... I guess that means we have
  4714.   35K of graphics in the source code?
  4715.  
  4716. * Changed default spell list to 99.  Thus anyone playing the demo version
  4717.   will definitely see lots of spells that they never get a chance to cast.
  4718.   hehehehe.
  4719. * Other miscellaneous bugfixes.
  4720. * Edited docs to include info about the demo version.
  4721.  
  4722. * BUGS: The Bonus Spell Window and the "Demo Over Window" are being
  4723.   overwritten by the animator task. FIXED.
  4724.  
  4725. * Reduced the length of a demo game to 18 turns because I played a test
  4726.   game and I won in about 15 turns due to Classic mode giving me lots of
  4727.   tough creatures to squash the independents with. (I was controlling 2
  4728.   wizards against 4 generators.)
  4729.   I seriously considered reducing it to 16 turns but I just can't decide...
  4730.   How long should it be?  What is your opinion?  10 turns?  18?  15???
  4731.   SAI: The demo needs to be long enough that people will get hooked onto
  4732.   some of the more strategic aspects of the game. Therefore, I think
  4733.   that it is ok to be able to win in demo mode. Maybe 15 turns would be
  4734.   good.
  4735.  
  4736. * BUG: The demo version of the game crashes when you try to exit the
  4737.   "Demo Over Window".  Calling TerminateChaos is the problem.  FIXED by
  4738.   making a new function QuitChaos() that can quit the game without crashing.
  4739.  
  4740.  
  4741. Tuesday, June 2nd, 1998.  I have made a smake demo of the game and played
  4742. it a few times on my A3000.  Everything works fine.  But when I put it on
  4743. an autobooting disk and try to play it on my A2000 w/68000 and OS 1.3 it
  4744. always crashes with a guru #00000000004 Illegal Instruction.
  4745. I thought this might be caused by the SASC optimizer bug but I have now
  4746. recompiled without the optimize parameter and it still does the same thing.
  4747. I can't find the autobooting version that I made back at christmas time. 8(
  4748. Do you still have it?  Maybe I am doing something different on this disk
  4749. that is causing things not to work.  I just don't know.  The problem should
  4750. be one of the following:
  4751. 1. SASC bug that is generating an 020+ instruction somewhere. (possible)
  4752. 2. Devpac bug that is generating an 020+ instruction somewhere. (doubtful)
  4753. 3. A68K asm bug that is generating an 020+ instruction somewhere. (possible)
  4754. 4. Not really an illegal instruction but merely a wrong file on the
  4755.    autobooting disk.
  4756. 5. Not really an illegal instruction but merely a missing file on the
  4757.    autobooting disk.
  4758. I am testing on an A2000 with 1 meg chip + 8 megs fast so I don't think
  4759. memory is the problem.
  4760.  
  4761. * OK I found the problem.  I didn't have the "run" command on the
  4762.   autobooting disk.  Execute(); requires run to be in the c: dir.
  4763.   Well luckily I only wasted an hour trying to figure that out.
  4764.  
  4765. Ok, now the intro isn't running... the fonts aren't loading...
  4766.   3 hours later ... after much trial and error I have it all working, geez
  4767. I am going to hafta document this autobooting disk format for future
  4768. reference.  Every time I make an autobooting disk I have these problems...
  4769.  
  4770. * Ok the game is now working on the 7Mhz 68000 but for some reason when you
  4771.   select a team all the checkmarks on setup screen I are redrawn.  This
  4772.   totally stops the quadrascopes for a second...
  4773.  
  4774. * Observations about playing the game on 7Mhz 68000:
  4775.   1. l key for line-of-sight is still too slow.  It can take up to 3
  4776.      seconds.  The days of the 7Mhz 1978 68000 are at an end.
  4777.   2. The r for range and m for move are nice and fast.
  4778.   3. The s for shoot was somewhat adequate.
  4779.   4. The quadrascopes move slower than what I am accustomed to.  Its a
  4780.      damn good thing I removed the OS clipping from them.
  4781.   5. The Color cycling on the "new game" and "quit game" requesters is much
  4782.      slower but this actually makes it look better IMHO.
  4783.   6. The left pentagram blinks noticeably.  So much for getting away with
  4784.      no double buffering.  The right pentagram is nice and solid.
  4785.  
  4786. * ChipRam  availabilty for Chaos v2.3d on a 512k chipram system:
  4787.   During the Intro:          55008 bytes free!  yeah!  We made it!!!!
  4788.   During Setup Screen I:     63848 bytes free!
  4789.   During main game:         256200 bytes free!
  4790.   During Information panel: 242200 bytes free!
  4791.   During Quit Requester:    205400 bytes free!
  4792.  
  4793.   We are currently using 380k of fastram. (So v2.3f should be about 440k)
  4794.  
  4795.   These numbers mean that as soon as I start work on the sound and music
  4796.   upgrade the game will require 1 meg of chipram or more + 1 meg of fastram
  4797.   or more.
  4798.  
  4799. * I have now tested this OS 1.2 Autoboot Disk on an OS 3.0 stock A1200 in
  4800.   both ECS and AGA modes and it doesn't work due to incompatibilities with
  4801.   the OS versions of various libraries and cli commands.  We will have to
  4802.   make a separate autoboot disk for at lest the 2 major versions of the OS.
  4803.  
  4804.  
  4805. ******************** AUTOBOOTING DISK FORMAT ******************************
  4806. ===========================================================================
  4807.  
  4808. * Documentation for making an Autobooting floppy disk version of the game:
  4809.   The disk must contain the following files in the following directories.
  4810.   They are ALL REQUIRED.
  4811.   I'm not on the internet right now or I would download one of those nifty
  4812.   dirtree utils.  Oh well, I'll just include a complete directory listing.
  4813.  
  4814. The docs may be placed in the root directory along with an icon and the
  4815. "more" command if there is room for it all.
  4816.  
  4817. Directory "df2:" on Sunday 07-Jun-98
  4818. libs                         Dir ----rwed Tuesday   09:58:44
  4819. s                            Dir ----rwed Tuesday   11:02:11
  4820. c                            Dir ----rwed Tuesday   10:54:40
  4821. devs                         Dir ----rwed Tuesday   05:22:12
  4822. l                            Dir ----rwed Tuesday   05:23:30
  4823. Chaos                        Dir ----rwed Wednesday 02:18:06
  4824. Chaos.info                   drawer icon for dragging onto harddrive.
  4825. 6 directories - 12 blocks used
  4826.  
  4827. Directory "df2:libs" on Sunday 07-Jun-98
  4828. diskfont.library            4964 13-Aug-88 For access to fonts.
  4829. translator.library         10592 13-Aug-88 For the computer voice.
  4830. req.library                18436 07-Jul-93 For the awesome filerequester.
  4831. 2 files - 71 blocks used
  4832.  
  4833. Directory "df2:s" on Sunday 07-Jun-98
  4834. Startup-Sequence             158 -s--rwed Tuesday   11:02:11
  4835. 1 file - 2 blocks used
  4836.  
  4837. Directory "df2:c" on Sunday 07-Jun-98
  4838. run                         2568 30-May-78 for Execute();
  4839. assign                      3008 30-May-78 to assign the Chaos_Game: path
  4840. FastMemFirst                 976 --p-rwed 30-May-78 16:28:46
  4841. SetPatch                    3844 30-May-78 for OS patches
  4842. Add36k                       648 13-May-92 To save 36k of chipram.
  4843. cd                          1756 30-May-78 To assign the Chaos_Game: path
  4844. avail                       1964 --p-rwed 30-May-78 16:27:15
  4845. list                        9972 --p-rwed 30-May-78 16:28:02
  4846. more                       16912 ----rwed 13-Mar-78 10:34:23
  4847. 9 files - 95 blocks used
  4848. list, avail and more are not required at this time.  I just like to use
  4849. those commands a lot so I always put them on my disks.  FastMemFirst isn't
  4850. strictly required either; I just figured it was a good idea.
  4851.  
  4852. Directory "df2:devs" on Sunday 07-Jun-98
  4853. System-Configuration         232 13-Aug-88 For default 80-column display
  4854. ramdrive.device             2128 13-Aug-88 for the RAM: drive
  4855. narrator.device            23280 13-Aug-88 For the computer voice.
  4856. 3 files - 55 blocks used
  4857.  
  4858. Directory "df2:l" on Sunday 07-Jun-98
  4859. Ram-Handler                 6464 13-Aug-88 for the RAM: drive
  4860. Speak-Handler               4216 13-Aug-88 for the computer voice
  4861. 2 files - 24 blocks used
  4862.  
  4863. Directory "df2:Chaos" on Sunday 07-Jun-98
  4864. fonts                        Dir ----rwed Tuesday   10:17:13
  4865. Music                        Dir ----rwed Tuesday   10:26:42
  4866. Chaos                     328764 ----rwed Wednesday 02:15:39
  4867. chaos.prb                   6729 ----rw-d 14-Apr-98 20:37:19
  4868. classic.prb                 6471 ----rw-d 14-Apr-98 20:37:20
  4869. pool.ssc                   42319 ----rwed Monday    19:12:31
  4870. Start_Chaos                  311 ----rwed 31-Mar-98 05:49:42
  4871. Start_Chaos.info            2566 ----rwed 31-Mar-98 05:49:43
  4872. chaos.dat                  66368 ----rwed Monday    19:15:43
  4873. 7 files - 2 directories - 901 blocks used
  4874.  
  4875. Directory "df2:Chaos/fonts" on Sunday 07-Jun-98
  4876. chaos.font                   264 ----rwed 01-Apr-98 22:23:30
  4877. chaos                        Dir ----rwed 01-Apr-98 22:23:29
  4878. Union.font                   524 ----rwed 31-Mar-98 05:51:22
  4879. Union                        Dir ----rwed 31-Mar-98 05:51:22
  4880. 2 files - 2 directories - 9 blocks used
  4881.  
  4882. Directory "df2:Chaos/fonts/chaos" on Sunday 07-Jun-98
  4883. 8                           1724 ----rwed 01-Apr-98 22:23:29
  4884. 1 file - 5 blocks used
  4885.  
  4886. Directory "df2:Chaos/fonts/Union" on Sunday 07-Jun-98
  4887. 34                          5972 ----rwed 31-Mar-98 05:51:22
  4888. 70                         21948 ----rwed 31-Mar-98 05:51:22
  4889. 2 files - 57 blocks used
  4890. Both sizes of the Union Font are used in the game.
  4891.  
  4892. Directory "df2:Chaos/Music" on Sunday 07-Jun-98
  4893. Mod.ChaosTheme1           192226 ----rwed 01-Apr-98 22:38:40
  4894. 1 file - 377 blocks used
  4895.  
  4896. TOTAL: 31 files - 10 directories - 1608 blocks used
  4897.  
  4898.  
  4899. The startup-sequence should look something like this:
  4900. c/add36k
  4901. c/SetPatch >NIL: ;patch system functions
  4902. c/FastMemFirst ; move C00000 memory to last in list
  4903. c/assign t: ram:
  4904. c/assign c: c/
  4905. c:cd chaos/
  4906. c:run chaos
  4907.  
  4908. ******************** END AUTOBOOTING DISK FORMAT **************************
  4909. ===========================================================================
  4910.  
  4911. I just played a test game of the demo version on my A2000 and at one point
  4912. a computer wizard was killed by a fire and the WizardExplode effect started
  4913. then the game crashed with a guru #000004.
  4914.  
  4915. I played another test game on my A2000 and this time the game crashed when
  4916. a bolter wall shot my wizard and killed me.  The WizardExplode effect
  4917. started and then the game crashed.
  4918.  
  4919. This is quite strange because I've played several test games on my A3000
  4920. and I have killed lots of computer wizards with no crashes.  I have even
  4921. killed several wizards on the A2000 and not had any crashes.
  4922.  
  4923. This bug is probably being caused by either
  4924. A: clipping is somehow turned off during the wizardexplode effect and when
  4925.    the effect goes off the edge of the screen it crashes the game.  But if
  4926.    this were true then it should crashe EVERY time a wizard dies, not just
  4927.    some of the time.
  4928. B: It is a bug that affects all wizards killed by fire or any human wizard
  4929.    that dies in any way.
  4930. Never mind the above paragraphs; all is fixed now. Read next paragraph.
  4931.  
  4932. * BUG: game sometimes crashes when WizardExplode effect reaches edge of
  4933.   screen.  FIXED by getting a lock on the board while doing the effect.
  4934.   This ensures that clipping is turned on.
  4935.  
  4936. * As a general rule, graphical effects should get a lock on the board just
  4937.   to prevent graphics mish-mash.  And they should get a lock on the board
  4938.   in case the effect writes past the edges of the screen.  If an effect
  4939.   doesn't get a lock then clipping might at that moment be on or off.
  4940.   Getting a lock ensures that clipping is in it's default state (ON).
  4941.  
  4942. * BUG: sometimes computer players get to move twice.  Independents never seem
  4943.   to be able to move twice though.  This bug never seems to happen until
  4944.   after some wizards have died. NOW FIXED.
  4945.  
  4946. * BUG: The speech always seems to work during casting phase but it seems to
  4947.   only work randomly during movement phase.  Hacking more changes to Say()
  4948.   in an attempt to make this problem go away.
  4949.  
  4950. * OK I think I found the speech bug: an intervening use of text_store
  4951.   between say() and waitforsay().  Tested and the speech is working 100%
  4952.   now.
  4953.  
  4954. * Made various changes to print what is being said first, then actually
  4955.   saying it.  Thus you can read what it is saying for the 2 or 3 seconds
  4956.   that it is saying it.
  4957.  
  4958. * CHANGED Aerial Servant and Combat to be CLASSIC.
  4959.  
  4960. * BUG: Spriggan speech doesn't work. Allegedly FIXED by removing the "2"
  4961.   from the end of the speech.
  4962.  
  4963. * Speeded up TestPixel.  Saved 4 cycles on 68000 or 2 cycles on 68030.
  4964. * TestPixel is now known as TestPixel4.  It tests the first 4 bitplanes of
  4965.   any rastport.
  4966. * Made new TestPixel1 Routine which only tests the first bitplane of a
  4967.   rastport.  I needed this routine for various purposes.
  4968.  
  4969. * Put in some checksums for lamer protection.
  4970.  
  4971. * BUG: Any errors in the early startup phase (e.g. it can't open a certain
  4972.   file) result in a crash.  NOW FIXED.
  4973.  
  4974. Now that I know we have enough chipram laying around...
  4975. * CHANGED: the default font for the game to be pearl.font (now included
  4976.   in the fonts/ dir.)  I did this for 3 main reasons:
  4977.   1. Games which use the standard topaz font always seem "cheap" compared
  4978.      to games which use their own custom font.  It just somehow feels more
  4979.      "commercial" when you play a game with a font different than the one
  4980.      you are used to looking at all the time.
  4981.   2. The lowercase i of Topaz sucks.
  4982.   3. I have tested many, many fonts to find the one which is the easiest to
  4983.      read.  And pearl is it.  I have had pearl.font as the default font on
  4984.      my Amiga for several years now.  It just makes everything easier to
  4985.      read.  _Especially_ 640x512 resolution text which is the resolution
  4986.      that I run everything in.  I realize that Chaos does not currently use
  4987.      that high a resolution but I just tested several fonts a few mins ago
  4988.      against pearl in 640x256 mode and I could still see the difference.
  4989.  
  4990. * SMOOTHED out the outlining of the Large font during the intro.  The
  4991.   outlining used to appear blocky on certain letters.  Now the jagged edges
  4992.   are rounded off.  This has the drawback of almost doubling the execution
  4993.   speed of FancyWriteText but the slowness will really only be noticeable on
  4994.   the 7 Mhz 68000 and for UAE lamers.  Oh well.... too bad for them...
  4995.  
  4996. * STUPID: Computer wizards cast Ball Lightning on a Generator which
  4997.   already had 0 combat. NOW FIXED.
  4998.  
  4999. * STUPID: Computer wizards cast Demonic Touch on other wizards who only
  5000.   had 1 combat point. NOW FIXED.
  5001.  
  5002. * ADDED: Stupidity checking for Shocker.
  5003. * IMPROVED: Stupidity checking for Archery.
  5004.  
  5005. * BUG: The "Wings" mouse Pointer and the "X" mouse pointer became
  5006.   corrupted at one point.  This was possibly caused by a wizard dying in the
  5007.   upper left corner or by another wizard dying by being covered with a
  5008.   growth.  I _think_ I fixed this but I don't really know.
  5009.  
  5010. * BUG: FLAG_NOWIZARDCELL is broken.  Wizards routinely cast spells like
  5011.   Subversion and Betrayal, etc. on creatures which have mounted wizards.
  5012.   NOW FIXED.
  5013.  
  5014. * BUG: That silly clipping bug has reappeared again!  I don't get it.  Now
  5015.   the WizardExplode effect is not working again. Argh. It is drawing
  5016.   Wizards all throughout chipram... they circle around over and over again
  5017.   at an angle on the LoRes Screen and they bleed over into the HiRes screen
  5018.   and they even pour out into the workbench screen and the CPR screen!
  5019.   I have verified that
  5020.   rastPortLayer and rastPort->Layer are somehow both set to 0 before this
  5021.   function is called.  ???? .... 3 hours later... Ok, I figured it all out.
  5022.   I had made a change at the beginning of start.tex to derive the variable
  5023.   "rastPort" from the lores screen.  But doing that gives a pointer to a
  5024.    rastPort with no cliprect and no layer information.  We must derive the
  5025.   global variable "rastPort" from the backdrop window (which is how you had
  5026.   it set up all along until I changed it in ignorance of this behavior).
  5027.   ALL FIXED NOW!
  5028.  
  5029. * The above fix has apparently made that mysterious blue 1-pixel line on
  5030.   the left edge of the screen go away.
  5031.   SAI: This line periodically appeared for me during my test games, but
  5032.   I was unable to determine the exact circumstances.
  5033.   JC: I think it is something do with layers.library and enabling/disabling
  5034.   OS Clipping.
  5035.  
  5036. * STUPID: My allied wizard just cast a pool far away from himself and right
  5037.   up next to his enemy's base camp. FIXED.
  5038.  
  5039. * STUPID: Wizards sometimes cast Magic Wood trees directly adjacent to
  5040.   enemy wizards. FIXED.
  5041.  
  5042. * NEW FUNCTIONS: IsAdjacentEnemyWizard(Cell *), IsAdjacentTeamWizard(Cell *)
  5043.  
  5044. * LESS THAN INTELLIGENT: Computer wizards only cast castles directly
  5045.   adjacent to themselves, they never cast castles across the screen to be
  5046.   adjacent to one of their allies.  NOW FIXED and totally cool.
  5047.  
  5048. * MAJOR BUG: I just moved my Aerial Servant onto a Mass Resurrect Scroll.
  5049.   Then somebody justiced my servant and killed it and I guess it "reinstated"
  5050.   the scroll.  Anyway there is now a weird creature whose 3 frames of
  5051.   animation are Lion, Dead Lion, Mass Resurrect Scroll.  It's stats are
  5052.   totally freaked out with numbers like 78 and -78. It eats Hydras, it's
  5053.   Mountable Set 1 and it's a flying meditation growth that can attack both
  5054.   living and undead creatures. Weird stuff. The mouse thinks it is a Mass
  5055.   Resurrect scroll that belongs to me, therefore its movement bit doesn't get
  5056.   cleared so I can't click on it and move it.  darn. I didn't have time to
  5057.   try to mount it.  I wonder what would have happened?      NOW FIXED.
  5058.  
  5059. * FLAW: I tried to cast my python on a Ghost scroll and it said "Cannot cast
  5060.   on Creatures" rather than the more appropriate "Cannot cast on Scrolls"
  5061.   FIXED.
  5062.  
  5063. * BUG: A Faun Scroll just put my Ghoul to sleep! FIXED.
  5064.  
  5065. * BUG: Dark Powering a snake that is standing on a scroll kills the snake and
  5066.   makes the scroll disappear.  FIXED.
  5067.  
  5068. * BUG: Creature died on scroll.  Scroll was still there.  I collected the
  5069.   scroll and moved away but the corpse was not there anymore!  THIS IS NOT A
  5070.   BUG, JUST A LIMITATION OF THE GAME, sorry.
  5071.  
  5072. * BUG: snake stands on dead vampire.  Justice Snake regenerates a living
  5073.   vampire rather than an undead vampire.  ERADICATED.
  5074.   SAI: I actually knew about this, thought it would be a good trap for
  5075.   young players :-)
  5076.   JC: Yeah, I went back and reread this section a few weeks after I changed
  5077.   this and I thought to myself: "Hmmm... maybe I shouldn't have done that?
  5078.   Oh well, its done now."  Should we make some sort of rule about this?
  5079.  
  5080. * BUG: Play a game with 99 scrolls.  Start a new game.  After ScrollDelay
  5081.   turns NOBODY is awarded jillions of spells from many (but not all) blank
  5082.   spaces on the board.  Traced this to a problem in ClearBoard(); NOW FIXED.
  5083.  
  5084. * BUG: Generator Scroll just generated a Hydra.  This was so hilarious that I
  5085.   almost left this bug in the game... oh well, I FIXED it.
  5086.  
  5087. * BUG: I was riding a unicorn and I cast reincarnate on my unicorn.
  5088.      I was surrounded by enemy monsters, they killed my unicorn and it
  5089.      reincarnated into a spider then they killed the spider and it became
  5090.      a beetle then a goblin killed the beetle and stepped onto the square!
  5091.      I could still cast spells but I couldn't dismount the independent
  5092.      goblin.  This goblin also had an identity crisis; each turn when I
  5093.      clicked on the "end turn" gadget; this goblin would attack independent
  5094.      creatures for me all on its own.  But when it was the
  5095.      Independent's turn it would act like an independent goblin and attack
  5096.      my creatures.  I made a small correction to Reinstate() and tested it
  5097.      so this is NOW FIXED.
  5098.  
  5099. * BUG: I killed 5 things with my WoodElf and it sure enough became a
  5100.   DreadElf but it belonged to NOBODY!  FIXED.
  5101.  
  5102. * BUG: I killed 7 things with my GreenDragon and it became an Emerald
  5103.   Dragon belonging to NOBODY.  FIXED.
  5104.  
  5105. * BUG: I killed 20 things with my RedDragon but it didn't give me a Vampire
  5106.   Spell.  FIXED.
  5107.  
  5108. * NOTICED: that due to all of our code cleanups, the Vortex no longer
  5109.   leaves a trail of distorted space in its wake.  I suppose this is for the
  5110.   best.  I guess we should change the spell description accordingly?
  5111.  
  5112. BUG: Trying to use the menus at the VERY beginning of the game before it
  5113. has time to say "Player 1" results in a machine crash.  Leaving this one
  5114. for SAI.
  5115. SAI: I got a recoverable alert. I have been unable to fix this. I not
  5116. sure why it happens, esp. with the tick menus as they are completely
  5117. controlled by Intuition. Perhaps it is something to do with clipping?
  5118. Jeeps. It even does it if you just use the RMB and don't actually
  5119. select anything! May have found the problem, I was getting timeout
  5120. messages for window events---this is a potential memory leak.
  5121. No, I have now discovered this problem is caused by doing too many
  5122. ReleaseSemaphore operations. Somehow MENUVERIFY is not set at
  5123. this early stage, and therefore the semaphore never gets locked.
  5124. I have patched this problem by checking the semaphore status before
  5125. attempting to release it. This work, but it is technically illegal
  5126. because it makes an assumption about the Semaphore structure. Looking
  5127. at HandleIDCMP it badly needs to rewritten, even has a goto in it
  5128. at the moment! NOW FIXED
  5129.  
  5130. At the beginning of this next upgrade I had already made countless changes
  5131. to every source code file including lots of spell files and even msg.tex so
  5132. I went on ahead and made more changes by implementing the following:
  5133.  
  5134. ***************************************************************************
  5135. ***************** SOURCE CODE READABILITY UPGRADE *************************
  5136. *****************       PART I: PROTOTYPES        *************************
  5137. ***************************************************************************
  5138.  
  5139. * Sunday: Completed Audio.tex through move.tex.  I'll do the rest tomorrow.
  5140. * Monday: Completed through part of prog.tex then had to go to work. 8(
  5141. * Monday Night: Completed through start.tex then passed out.
  5142. * Tuesday Morning: Completed all .tex files + tex2c.c.
  5143.  
  5144. * Replaced all prototypes with complete versions.
  5145. * Eliminated several duplicate prototypes.
  5146. * Various other code cleanups.
  5147.  
  5148. No more Function(int,int,int,int,int);!
  5149.  
  5150. All prototypes replaced with the form of:
  5151. Function(int SourceX, int SourceY, int DestX, int DestY, int iterations);
  5152.  
  5153.  
  5154. ***************************************************************************
  5155. ***************** SOURCE CODE READABILITY UPGRADE *************************
  5156. *****************         PART II: SYNTAX         *************************
  5157. ***************************************************************************
  5158. *****************  NEW PROGRAMMING LANGUAGE: JC   ***********************
  5159. ***************************************************************************
  5160.  
  5161. I got sick of the lameness of C so I invented a new language called JC.
  5162. JC stands for "James' C", "James Conwell" and "GET THOSE GAWDAM FUCKING
  5163. PIECE OF SHIT LAME-ASS BRACES {} OUTTA MY FACE!" 8)
  5164.  
  5165. Have you ever wished C didn't have all those lame curly braces? {}
  5166. Then JC is for you.
  5167.  
  5168. Have you ever wished C had Array Bounds Checking?
  5169. Then JC is for you.
  5170.  
  5171. Have you ever wished C would properly indent your source code for you?
  5172. Then JC is for you.
  5173.  
  5174. Have you ever said "C is the greatest language ever.  Its ease of use is
  5175. remarkable, its syntax is unsurpassed and its execution speed cannot be
  5176. matched by even the best assembly language programmers"?
  5177. Then you are seriously deranged and JC is not for you.
  5178.  
  5179. Here are the specifications for JC:
  5180. 1. It is exactly the same as C, with the following exceptions:
  5181.    A. Braces {} are only used to define Arrays and Structures, or in a case
  5182.       block to create some new temporary variables.
  5183.    B. You can use "and" or "AND" instead of &&.
  5184.    C. You can use "or"  or "OR"  instead of ||.
  5185.    D. IF statements end with END_IF and need not contain any braces {}.
  5186.    E. FOR statements end with NEXT  and need not contain any braces {}.
  5187.    F. SWITCH statements end with END_SWITCH and need not contain any braces.
  5188.    G. DO_WHILE(condition) blocks can end with LOOP or LOOP_WHILE(condition)
  5189.       or LOOP_UNTIL(condition).
  5190.    H. DO_UNTIL(condition) blocks can end with LOOP or LOOP_WHILE(condition)
  5191.       or LOOP_UNTIL(condition)
  5192.    I. Functions begin as usual with the type of return, name of function
  5193.       and parameter list followed by the keyword FUNCTION which begins the
  5194.       FUNCTION block.  The FUNCTION block is terminated by the END_FUNCTION
  5195.       statement.
  5196.    J. You may have a WHILE condition or an UNTIL condition at the top of a
  5197.       loop, the bottom of a loop or both via DO_UNTIL/DO WHILE and
  5198.       LOOP_UNTIL/LOOP WHILE thus you can have a loop like:
  5199.  
  5200.       DO_UNTIL (x<0)
  5201.         blahblahblah();
  5202.       LOOP_WHILE (z!=y and z!=1)
  5203.  
  5204. 2. JC is easily transportable to every computing platform on Planet Earth.
  5205.    (or at least those which have C compilers.)
  5206. 3. JC has the option of properly indenting your source code.
  5207. 4. JC has the option of generating additional code for Array Bounds
  5208.    Checking. (Not yet implemented.)
  5209.  
  5210.  
  5211. Why is C so lame?
  5212. I could write an entire book documenting all the reasons why C is a lame,
  5213. obnoxious, crappy, primitive and barbaric language; however, I will only
  5214. write about those problems which are fixed by using JC.
  5215.  
  5216. I have wasted countless hours trying to debug large, complicated programs
  5217. which are very deep. "Deep" meaning deeply nested ifs within ifs within
  5218. elses within fors within switches right next to other ifs within fors with
  5219. elses within ifs within other switches, etc.
  5220.  
  5221. The reason for my wasted time is simple. The following symbol is nearly
  5222. meaningless "}".  The close brace doesn't tell me jack about what is going
  5223. on in the program.  It's definition is so completely vague that it makes
  5224. reading a program and debugging it very confusing.  } means "end a block of
  5225. code".  Well, whoop-dee-doo.  What the hell kind of block is it
  5226. ending??!?!?!?  _Which_ block of code is it ending?!?!???  You just don't
  5227. know.  It could be ending a FOR block or a SWITCH block or an IF block or
  5228. an elseif block or an ELSE block or ...
  5229.  
  5230. In JC a FOR block is ended with NEXT.  A SWITCH block is ended with
  5231. END_SWITCH.  An IF block is ended with END_IF.
  5232.  
  5233. Thus when you look near the end of a large function instead of seeing this:
  5234.  
  5235.              }
  5236.            }
  5237.          }
  5238.     s=0;
  5239.       }
  5240.    }
  5241. }
  5242.  
  5243. You will be able to see some text that actually has real meaning.
  5244.  
  5245.  
  5246. IF you start a block of code THEN you must end a block of code. This is
  5247. logical, proper and grammatical.  No more constructions like:
  5248. if (x)
  5249.    Blahblahblahblahblah();
  5250.  
  5251. You should rewrite it to be all on one line or like this:
  5252. IF (x) THEN
  5253.    Blahblahblahblahblah();
  5254. END_IF
  5255.  
  5256. This is absolutely neccessary so the JC syntax checker can verify that all
  5257. of your blocks of code match up properly.
  5258.  
  5259. If you don't put an END_IF at the end of your IF block then how will the
  5260. syntax checker know if all your IF blocks line up properly???  It will
  5261. think that you forgot it (which is the purpose of JC, to catch those times
  5262. when you forget something).
  5263.  
  5264. IF you start a block of code THEN you must end a block of code. This is
  5265. logical, proper and grammatical. 
  5266.  
  5267. SHORTCUT exception: You may have SINGLE line IF statements where the ENTIRE
  5268. IF (condition) statement(); is ALL on 1 line.  So you still have a shortcut
  5269. for simple IFs.  This shortcut should OMIT the word THEN or it won't
  5270. compile correctly.  Of course, all multiline IFs must include the THEN
  5271. keyword.
  5272.  
  5273.  
  5274. If you want your IF statement to use more than one line then you MUST use
  5275. END_IF.  That is the rule.  And it makes the program easier to read.  And
  5276. it allows the syntax checker to find those obnoxious bugs in deep code and
  5277. it allows the JC formatter to properly indent your source code.
  5278.  
  5279. END_IF, NEXT and END_SWITCH should be located on a line by itself, as the
  5280. whole purpose of these keywords is to aid human readability and the only
  5281. way we can accomplish this is for the end block markers to stand out from
  5282. the crowd.
  5283.  
  5284. Here are some examples of C code vs. JC code:
  5285. C:
  5286. if (x) DoThis();
  5287.  
  5288. JC:
  5289. IF (x) DoThis();
  5290.  
  5291.  
  5292. C:
  5293. IF (x) {
  5294.   DoThis();
  5295.   DoThat();
  5296. }
  5297.  
  5298. JC:
  5299. IF (x) THEN
  5300.   DoThis();
  5301.   DoThat();
  5302. END_IF; <--- Semicolon optional.
  5303.  
  5304.  
  5305. C:
  5306. IF (x) {
  5307.   DoThis(); DoThat(); DoTheOther();
  5308. }
  5309.  
  5310. JC:
  5311. IF (x) THEN
  5312.   DoThis(); DoThat(); DoTheOther();
  5313. END_IF
  5314.  
  5315.  
  5316.  
  5317. C:
  5318. IF (x){
  5319.   DoThis();
  5320.   DoThat();
  5321.   DoTheOther(parameter1, parameter2, parameter3, xyzzy, plugh, parameterZ, weird);}
  5322.   DoSomethingElse(blahblah);
  5323.   return(returnvalue);
  5324.  
  5325.  
  5326. JC:
  5327. IF (x) THEN
  5328.   DoThis();
  5329.   DoThat();
  5330.   DoTheOther(parameter1, parameter2, parameter3, xyzzy, plugh, parameterZ, weird);
  5331. END_IF
  5332. DoSomethingElse(blahblah);
  5333. return(returnvalue);
  5334.  
  5335.  
  5336. C:
  5337. switch (code) {
  5338.    case 1:
  5339.      blahblah();
  5340.    case 2:
  5341.      blahblah();
  5342. }
  5343.  
  5344. JC:
  5345. SWITCH (code)       <--- Notice there is NO brace! {
  5346.    case 1:
  5347.      blahblah();
  5348.    case 2:
  5349.      blahblah();
  5350. END_SWITCH // (code)
  5351.  
  5352.  
  5353.  
  5354. Given that over 95% of the Earth's literate population does not know what
  5355. "&&" or "||" mean; it utterly boggles the mind to try to conceive why C uses
  5356. "&&" to mean "and" and "||" to mean "or".  Over half the world's literate
  5357. population knows what "and" and "or" mean, and 100% of the Earth's
  5358. English-Speaking population knows what "and" and "or" mean.
  5359.  
  5360. Given that the & is used to derive the address of a variable, to logically
  5361. and bits together AND to mean "and" in the case "&&" we can see that the &
  5362. is really overused so && has been replaced with "and" in JC.
  5363.  
  5364. Ditto for || and "or".
  5365.  
  5366. Of course now that I have been seriously coding in C for 1.5 years and
  5367. occaissionally coding in C before that; I am now used to the && and ||.
  5368. However, I would have learned C years before if it had used standard "and"
  5369. and "or" notation.
  5370.  
  5371. Implementation in Chaos:
  5372. Since Chaos already transforms the original source code into real C code
  5373. via tex2c there is no reason not to expand its functionality to trasform JC
  5374. source code into plain C source code.  As it transforms the code it will
  5375. perform error checking to make sure that your NEXTs match with FORs and not
  5376. with an IF or a SWITCH, etc.  The code will also be properly indented.
  5377.  
  5378.  
  5379. Major problem discovered with C macros:
  5380.  
  5381. FOR(i=1,j=1;i<=wizards[p].BonusArrayPointer;i++,j++)
  5382.  
  5383. The FOR macro won't work in the above example due to the , (comma) meaning 2
  5384. different parameters.  So we must find a way to make a macro work with any
  5385. number of parameters.  Either that or JC will have to preprocess the files
  5386. like tex2c does.
  5387.  
  5388. Or I could just rewrite the FORs to have i=1; j=1; right before the FOR.
  5389. NO that doesn't work because there is still i++,j++ at the end.... hmmm...
  5390. Changing FOR to take 10 parameters doesn't work either.  The macro wants
  5391. EXACTLY the number of parameters that have been defined for it.
  5392.  
  5393. Due to lameness in the C preprocessor there is no way to #define a macro
  5394. whereby EVERYTHING within the parenthesis () is considered to be just 1 big
  5395. parameter; therefore, I cannot implement FOR NEXT loops in a simple manner.
  5396. I must either preprocess the code and translate from the source file to a
  5397. new file or I can make up a DO keyword and continue to do everything within
  5398. tghe confines of #define statements.  The latter course of action is being
  5399. taken at this time.  So a FOR NEXT loop must look like this:
  5400.  
  5401. FOR (x=0;x<25;x++) DO
  5402.   blahblahblah();
  5403. NEXT
  5404.  
  5405. Sorry about the above inconvenience.
  5406.  
  5407. Luckily much of the work of implementing JC can be accomplished with clever
  5408. use of #define macros.
  5409. This has the advantage of working perfectly with the C debugger.
  5410.  
  5411.  
  5412. ARRAY BOUNDS CHECKING has not yet been implemented.  I have worked out the
  5413. basic algorithm for implementing it but I have had numerous personal
  5414. problems with work, my car breaking down and I had to move to a new house
  5415. then I got sick, so I have accomplished very little in the last month.
  5416. Therefore I will implement the array bounds checking either A) When it
  5417. becomes extremely important or B) whenever SAI has a lock on the gamecode
  5418. and I have nothing better to do.  In the meantime I will begin implementing
  5419. things which I hope are more important and more fun.
  5420.  
  5421. *****************************************************************************
  5422. **************** END NEW PROGRAMMING LANGUGAGE: JC **************************
  5423. *****************************************************************************
  5424.  
  5425. * Test Macro(x) vs. Macro (x)  Will it work?  YES!
  5426.  
  5427. * Thursday morning: Upgraded Audio.tex to new JC syntax Then had to go to
  5428.   work all day.
  5429. * Friday morning: Upgraded Bonus.tex to JC.
  5430.  
  5431. ** BEGIN 3 days off:
  5432. * Saturday Morning: Upgraded Cast.tex to JC.
  5433. * Saturday Evening: Upgraded Cell.tex to JC. 
  5434.  
  5435. * Sunday Morning: Upgraded cmove.tex, core.tex, graph.tex, part of editor.tex.
  5436. * Sunday Evening: Upgraded info.tex, init.tex.
  5437. * PLAYED a test game: Everything basically works ok.
  5438.  
  5439. * Monday Morning: Upgraded menu.tex and move.tex to JC.
  5440. * Monday Evening: Upgraded msg.tex, pointer.tex, pool.tex (lots of editing
  5441.   to the tex of pool.tex. 
  5442. * Played a test game: everything seemed to work ok, but at some point the
  5443.   Independents had a score of -11.  How is that possible?
  5444. * Upgraded pool2tex.tex and predicate.tex to JC.
  5445.  
  5446. * Tuesday Morning: Upgraded 75% of prog.tex to JC then had to go to work.
  5447. ** END 3 days off 8(
  5448.  
  5449. * Wednesday Morning: Finished upgrading prog.tex. Finally!
  5450. * Thursday Morning : Upgraded score.tex to JC.
  5451. * Friday Morning:    Upgraded spell.tex to JC
  5452. * SUSPICIOUS:  I noticed some code in IntelligentComputerSpellSelect() that
  5453.   disables the .necro or .forgot but there is only 1 chance in 32 of it
  5454.   happening.  There is similar code in GetSpells()
  5455.  
  5456. Begin 3 days off:
  5457. * Saturday morning: Upgraded start.tex, text.tex, warp.tex, flashywin.c to JC.
  5458.  
  5459. * Played a test game:  Everything seemed to work just fine except for:
  5460.  
  5461. * BUG: when a creature ends it movement the "Range = X" line of
  5462.   WriteNearBottom is not erased. FIXED.
  5463.  
  5464. * BUG: I was playing a game and  there were no indpendents left alive.
  5465.   After I went the computer said "INDEPENDENTS" and them immediately started
  5466.   making lots of bonus spell noises and stuff.  This was caused by the
  5467.   awarding of bonus spells from manabatteries etc.  So there needs to be
  5468.   some sort of notification that the game is processing the update phase and
  5469.   is NOT still doing the Independent movement.  FIXED.
  5470.  
  5471. * BUG: The Repulsion spell does not repel scrolls properly.  Sometimes there
  5472.   is a cell which contains nothing while the underpart contains the scroll
  5473.   that used to be there.  This results in NOBODY collecting lots of free
  5474.   scrolls from empty cells. FIXED.
  5475.  
  5476. I intentionally skipped over SPELLMAN.TEX  because AFAICR I
  5477. havent made any changes to this file.  I'll try to leave it untouched in case
  5478. SAI has made any changes to it during the past 2 months while we have been
  5479. out of communication.
  5480.  
  5481. * Saturday Evening: Upgraded io.tex to JC.
  5482.  
  5483. * Sunday Morning: Upgraded editor.tex to JC.  YAHOO!  All main program files
  5484.   are now upgraded to the new syntax!
  5485.  
  5486. * As I was upgrading all of the above files I corrected several places
  5487.   where an else appeared to be associated with a particular if based on its
  5488.   indentation but in fact was associated with a completely different if.
  5489.   I fixed them as I noticed them.  I left millions of other indentation
  5490.   errors for the JC formatter to fix automatically.
  5491.  
  5492. * FLAW: Abduction spell abducts artifacts then the artifact owners are
  5493.   immediately recalculated in the update phase so the net effect is nil.
  5494.   NOW FIXED: Abduction no longer targets artifacts.
  5495.  
  5496. BUG: I somehow did the menus too fast for the editor and the game sort of
  5497. locked up.  I couldn't get the menus to work anymore.  I was stuck and
  5498. unable to do anything.  Leaving this for SAI.
  5499. SAI: Probable symptom of ReleaseSemaphore in the wrong place. Or else
  5500. a double Obtain if two consecutive Obtains.
  5501.  
  5502. * I only upgraded the first 2 spell files (Abduction & AcidRain) to JC.
  5503.   I will either leave the rest of the spell files for SAI or I'll do them
  5504.   some other time.  Right now I need to work on the formatter.
  5505.  
  5506. Sunday:
  5507. * Joseph came over and we played a test game
  5508. * BUG: Plasma Beam locked up the game. (oops a misplaced END_IF) NOW FIXED.
  5509.  
  5510. * Put in some simple IFs to reduce the intensity of the background color
  5511.   on lissajous squares but this seems to have completely stopped the background
  5512.   color cycling 8(
  5513.  
  5514. * COOL! I FINALLY found the bug in my lissajous background color cycler!
  5515.   Now it does more or less what I had intended it to do!
  5516.  
  5517. Monday:
  5518. * Banged together a simple JCformat proggy.  Doesn't have any really fancy
  5519.   features yet.  Doesn't handle everything.
  5520.  
  5521. End 3 days off. 8(
  5522. Tuesday: Work on car.  Go to work. 8(
  5523.  
  5524. Thursday July 2nd, 1998: My psychotic bitch mom STOLE my car and now I can't
  5525. go to work! I was supposed to work all day today and make $100.00.  I will try
  5526. to do some programming but I am so upset I doubt I'll be able to concentrate.
  5527.  
  5528. * SUCCESSFUL TEST: I used JCformat on chaos.c and near the end of the
  5529.   program I noticed that the indentation was off.  This is what happens when
  5530.   something is mismatched... In this case it was an IF-THEN-END_IF problem.
  5531.   So even without strict alignment checking, the formatter can "detect" and
  5532.   show you where code structures don't match up by the fact that the
  5533.   indentation is OBVIOUSLY wrong.
  5534.  
  5535. * SUCCESSFUL TEST: JCformat on flashywin.c like this:
  5536.   JCformat flashywin.c flashywin.jc
  5537.   This produced a perfectly indented file that looked great to the naked eye.
  5538.   I then tested it with:
  5539.   diff -w t:flashywin.c t:flashywin.jc
  5540.   NO DIFFERENCE reported.
  5541.  
  5542.   Then I did JCformat t:flashywin.jc t:flashywin.jjc
  5543.   (I formatted the already formatted file)
  5544.   cmp t:flashywin.jc t:flashywin.jjc  says "Files Compare ok".
  5545.   So they are byte-for-byte identical.
  5546.  
  5547. * REPEATED ABOVE TEST on chaos.c.  Works perfectly!  YAHOO!
  5548.  
  5549. Well, here's the deal: I've used 2 character indentation on all my zillions
  5550. of TrueBASIC programs over the years and I loved it.  2 characters is the
  5551. minimum amount to be easily seen by the eye and it keeps my program
  5552. listings from going off the edge of the paper in those deep nests with long
  5553. lines in them.  I really like 2 character indentation because I like all of
  5554. my lines to be 140 chars or less because that is what I like to print my
  5555. programs out at.  Sometimes I use 160 characters per line (Courier 6
  5556. point).
  5557.  
  5558. But the Chaos source code had many places with 4 character indentation and
  5559. some blocks of code had 6 characters of indentation!  So switching from
  5560. that much indentation to only 2 chars seems like a bit of a shock and it
  5561. seems harder to read.  I honestly don't think it _is_ harder to read I
  5562. think it just _seems_ that way because we are used to something different.
  5563.  
  5564. Anyway I am breaking with tradition and using 3 chars of indentation as the
  5565. standard default.  This should be an ok compromise I hope.
  5566.  
  5567. If you don't like it you can always reformat it anyway you like.  It only
  5568. takes a second to reformat a file.
  5569.  
  5570. Consider BEGIN_STRUCT and END_STRUCT macros.
  5571. Consider DO_FOREVER and LOOP_FOREVER macros.
  5572.  
  5573. * PATCHES INSTALLED: I have downloaded all the SASC patches
  5574.   from Aminet and have installed them:
  5575.  
  5576. sc655pch.lha       biz/patch  1.0M 176+SAS/C V6.55 bug fix for Amiga SAS/C 6.50 and SAS/C 6.51.
  5577. sc656pch.lha       biz/patch  191K 144+SAS/C 6.56 Patch (requires 6.55)
  5578. sc657pch.lha       biz/patch  595K  89+SAS/C 6.57 Patch (requires 6.56)
  5579. sc658pch.lha       biz/patch  668K  49+SAS/C 6.58 Patch (requires 6.58)
  5580.  
  5581. * SCREWEY BUG ELIMINATED: Now that I am using the latest version of the C
  5582.   compiler that screwy bug that prevented us from compiling init.c with
  5583.   optimize=on has disappeared!  YAY!  Now that I am compiling init.c with
  5584.   optimize=on (for smake release) it is saving us 728 bytes on the
  5585.   executable filesize!
  5586.  
  5587. *****************************************************************************
  5588. ****************  SOURCE CODE READABILITY UPGRADE  **************************
  5589. ****************         PART 3: DEBUGGING         **************************
  5590. *****************************************************************************
  5591.  
  5592. Problem: When looking at the code in the debugger it looks completely
  5593. different from the real source code due to the fact that all the cool tex
  5594. comments have been stripped out.
  5595.  
  5596. Problem: Errors during compilation are reported at line number x, which has
  5597. no relation to the line number of the source code due to the fact that all
  5598. the cool tex comments have been stripped out.  Thus the line number given
  5599. is often 100+ lines wrong.
  5600.  
  5601. Since it is highly desirable to be able to see the program documentation in
  5602. the degubber while debugging, we must not strip out all of our tex
  5603. documentation.
  5604.  
  5605. Solution:
  5606.   1. The tex will no longer be stripped out.
  5607.   2. tex2c will no longer be used.
  5608.   3. A seperate program, c2tex can be used to generate a tex file.
  5609.      (Leaving the coding of this proggy to SAI but it will be easy.)
  5610.   4. Edit all makefiles to eliminate the use of tex2c.
  5611.   5. Change all occurences of 
  5612.      \section to /*\section
  5613.      \end{verbatim} to /*\end{verbatim}
  5614.      \begin{verbatim} to \begin{verbatim}*/
  5615.   6. No more .tex files used in compilation.  Only .c and .h files.
  5616.  
  5617. Thus all tex documentation will be embedded in C comment blocks. Thus there
  5618. is no need to strip it. Thus we can read it in the debugger.
  5619.  
  5620. This has the side effect of making the source code take less drivespace,
  5621. since there is only 1 copy of each source file, rather than 2 copies.
  5622.  
  5623. * Transformed and eliminated audio.tex, bonus.tex, cast.tex, cell.tex,
  5624.   cmove.tex, core.tex, editor.tex, info.tex,
  5625.   Upon recompiling init.tex I found a horrible bug that crashes the game
  5626.   every time.  I checked some old versions of the code (2.2 and 2.1) and the
  5627.   bug has been there for ages.  Funny how it never crashed the game till now.
  5628.   Anyway, it is FIXED now.
  5629.   Transformed io.tex, menu.tex, move.tex, msg.tex, pointer.tex,
  5630.   predicate.tex, chaos.tex, score.tex, spell.tex, start.tex, text.tex,
  5631.   warp.tex.
  5632.  
  5633. As a result, numerous files which were once combined together into large
  5634. .tex files are now their own standalone file. e.g. edmenu.dat, menumaker.c,
  5635. and others.
  5636.  
  5637. * I didn't convert pool2tex.tex, graph.tex or pool.tex yet since I
  5638.   presumably don't have to debug those and I am anxious to get back to some
  5639.   real coding.
  5640.  
  5641. * INSTALLED MUNGWALL & SUSHI: I was having a nasty random bug in JCformat
  5642.   so I installed MUNGWALL & SUSHI to try to find it.  It showed me the bug on
  5643.   the 1st try. I was writing 1 byte beyond the end of my allocated memory.
  5644.  
  5645. *****************************************************************************
  5646. **************** END SOURCE CODE READABILITY UPGRADE ************************
  5647. *****************************************************************************
  5648.  
  5649.  
  5650. Jerry came over and we played a game that lasted all night long.  We each
  5651. made our fair share of good and bad moves throughout the game.  For most of
  5652. the game Jerry had been winning like crazy.  This is partly due to the fact
  5653. that I waited and waited and waited till the last possible moment to use my
  5654. Invert spell then things started to change.  A few turns later and I was
  5655. definitely winning.  I could have won the game but then I got tired and
  5656. made an INCREDIBLY stupid move.  My wizard was in a tree and the tree
  5657. collapsed.  I had Magic Wings with 5 movement and LOTS of safe places to
  5658. move to.  But instead I hopped into the next tree.  BAD MOVE.  The next
  5659. tree only had *1* life point and my wizard had only 10 life points.  And
  5660. seeing as how that 1 particular square was one of the few on the board
  5661. where Jerry could attack me with 2 creatures at once.  I got killed.  Darn.
  5662. My Iridium horse had been really kicking some ass....
  5663.  
  5664. I wouldn't have died if it hadn't been for the fact that Jerry had control
  5665. of the only artifact on the board.  If not for that artifact my last move
  5666. would have been nothing more than an insignificant mistake.  But as it
  5667. happened I got killed. This is the 2nd human vs. human game I've played where
  5668. artifacts were directly responsible for the outcome of the game.
  5669.  
  5670. We played with 4 buried scrolls and 4 buried artifacts with scroll delay of
  5671. 3.  No Texas Trash'em.  6 computer wizards.
  5672. Every scroll we dug up was something really cool.  I dug up an Iridium
  5673. Horse Scroll and a kill scroll.  Obtaining the scrolls was quite
  5674. challenging because it took several turns to dig them up and then 3 more
  5675. turns to collect them.
  5676.  
  5677. One interesting event in the game occured when a mounted computer wizard
  5678. cast a Shadow City next to himself but refused to enter it.  My wizard had
  5679. magic wings with 5 movement points + Elf Boots + Combat + Recover Boost
  5680. so I immediately began to cross the entire board to get there.  It took 5
  5681. turns to make it inside the Shadow City.  I took a lot of damage along the
  5682. way.  My brother thought I was crazy for charging my wizard off like that.
  5683. It ended up being well worth it.  I got to pick 3 great spells from a list
  5684. of 10!  Awesome!
  5685.  
  5686. There were several turns in the game where I had to REALLY strategize
  5687. seriously in order to keep my brother from running me over.
  5688.  
  5689. Jerry cast a Tempest which really made the game exciting.  First it came at
  5690. me and charged into my group of creatures and scattered them out one by
  5691. one.  Jerry then used his group of creatures to kill them off one by one
  5692. since they had no backup and were isolated from their buddies.  This left
  5693. me VERY weak.
  5694.  
  5695. But a few turns later and the Tempest went into Jerry's territory and
  5696. started scattering his creatures in a similar fashion so this evened things
  5697. up somewhat.  What a great game.
  5698.  
  5699. Here are the bugs we found:
  5700.  
  5701. Jerry cast a cat lord and the cat lord immediately cast a Jaguar but the
  5702. Jaguar allegedly never moved (several turns) till Jerry killed the Cat Lord.
  5703. The cats which were already on the board when the Cat Lord was cast all worked
  5704. like they were supposed to.  They moved around and killed things, etc.
  5705. Unfortunately I didn't pay that much attention to it.  I think the Jaguar
  5706. may simply have been sitting by a pool the entire time.
  5707. SAI: I find this very hard to believe. Most likely the computer just
  5708. decided there was no benefit in moving it.
  5709.  
  5710. * TEMPEST BUG: Jerry cast a Tempest whose Life Force and Recovery and Combat
  5711.   kept mysteriously rising.  Furthermore, it managed to accumulate several
  5712.   Foes Killed every single turn even though it never killed anything.  And
  5713.   this happened whether it teleported something or not.  By the end of the
  5714.   game it had 54 Foes Vanquished.
  5715.  
  5716.   Ok I have determined that Tempests were "killing" every empty cell that
  5717.   they moved onto and they were also "killing" every dead body that they
  5718.   were moving onto.  Presumably, killing an empty cell was its favorite
  5719.   food and that is why its stats were raising so high.
  5720.   TEMPEST BUG FIXED.
  5721.  
  5722. * BUG: Sleeping Tempests could still move. FIXED.
  5723.  
  5724. * IMPROVED SCROLLING: Due to a misunderstanding of arcane timing lore, the
  5725.   scrolling of the screen in the intro was, in fact, only executing at 25 fps.
  5726.   It now runs at 50 fps for faster, smoother operation.  Unfortunately, the
  5727.   scrolling jerks a little bit each time the OS does something for 1 frame.
  5728.  
  5729. * SCROLLING now at priority 50.  This fixes the above occaissional glitches
  5730.   for nearly all situations.
  5731.  
  5732. * INSTALLED ENFORCER in my User-Startup so it will always be running from
  5733.   now on.  "enforcer stdio"
  5734.  
  5735. * Paid $165.00 for a unix shell account for 6 months.  They then REFUSED to
  5736.   send me any info about how to access my unix shell account.  But they did
  5737.   tell me how to get into my ppp account.  I have asked them repeatedly and
  5738.   they simply will NOT tell me how to access the unix shell account. Damn
  5739.   bastards.  I have spoken to some people who do not work for this ISP and
  5740.   they are of the opinion that the unix shell account CANNOT be accessed
  5741.   without first logging into the ppp account!  ARGH!!!!
  5742.  
  5743. * NEW HARD DRIVE purchased and installed.  It is a 4.3 gigabyte Quantum
  5744.   Fireball SCSI drive that cost me $300.00.  I now have ROOM!  YAY!!!
  5745.   I can actually _install_ software on my Amiga!!!!!! Coolness!
  5746.  
  5747. * INSTALLED MUI 3.6 + Miami 1.1 + AmFTP 1.89a and everything worked great on
  5748.   the first try!  However I was having probs with ftp transfers so I upgraded
  5749.   to the following:
  5750.  
  5751. * INSTALLED MUI 3.8 + MIAMI 3.0 + IBROWSE 1.2 + AmFTP 1.89a + WorldNews1.0.
  5752.   NOTES:  Hotmail won't let me send attachments with Ibrowse.
  5753.           Miami 3.0 is MUCH more difficult to install than 1.1 was. 8(
  5754.       Installing all this new software made no difference to my ftp
  5755.       transfers.  Every ftp site on earth seems to work perfectly
  5756.       except for 1.  It just doesn't work right no matter what I do.
  5757.       Luckily this is irrelevant.
  5758.  
  5759. * I am now on the net with a ppp account.  This sure makes uploading and
  5760.   downloading a lot easier.
  5761.  
  5762. I still need to install an Email proggy.
  5763. I still need to install Directory Opus Magellan.  It is supposed to be the
  5764. ULTIMATE piece of software.  It is supposed to be the BEST for ftp and the
  5765. BEST for viewing and adding/deleting files from/to compressed archives and
  5766. millions of other things.
  5767.  
  5768. * Put in 3 different MeltScreen effects. There is a problem in knowing how
  5769.   to redraw the right hand side of the screen after this effect.
  5770.   I don't know how to solve this.
  5771.  
  5772. * Biohazard now uses the MeltScreen(SINK) effect.
  5773.  
  5774. List of spells that might go well with the MeltScreen effect.
  5775. *meddle, mutate, *dissection, acid rain, disrupt,
  5776.  
  5777.  
  5778. I want to use MeltScreen(SUCK) with devastation but I don't want the screen
  5779. to be redrawn until after all the appropriate cells have been
  5780. killed/reinstated.  So how should I do this?
  5781.  
  5782. A) add a REDRAW option to MeltScreen. Then call MeltScreen(NOREDRAW) then
  5783.    manually redraw the screen in the .spl file.
  5784. B) add a "function to be called before the redraw is done" option.
  5785.    If this function address is not null then it will be called before any
  5786.    redrawing is done.
  5787.  
  5788. I implemented option B but then I realized that this wouldn't work because
  5789. the spell handler needs access to some variables so I am making all those
  5790. variables STATIC and moving CastFreeSpell and CastMagicSpell near the end
  5791. of cast.c.  I couldn't think of any disadvantages to doing this. (Not that
  5792. my judgement is any good right now since I am still extremely sick at the
  5793. time of this writing.)
  5794.  
  5795. This now means that we are 1 small step closer to being able to have
  5796. seperately compiled spell handlers since each spell handler can now be its
  5797. own seperate, independent function with access to all the game's global
  5798. variables + these few semi-global (STATIC) variables such as id, player, p,
  5799. b, wizardsp, wizard_cell and w_stat.
  5800.  
  5801. I am not saying that we 100% want the capability to have seperately
  5802. compiled spell files but it would be nice to have that _option_, should we
  5803. decide that it is desirable.
  5804.  
  5805. * Devastation now uses MeltScreen(SUCK)
  5806.  
  5807. I didn't pick a spell to use MeltScreen(SWIM).  I'll leave this for SAI.
  5808.  
  5809. * WaveScreen effects: You can now make the entire screen wave with
  5810.   StartWavyTask(screen,1);  Small numbers mean more radical waving.  Larger
  5811.   numbers mean very gentle waving.  I implemented this as its own task
  5812.   because this effect can be used WHILE WE PLAY THE GAME AS USUAL. Kewl!
  5813.  
  5814.   Of course if you don't want it waving the screen in the background just
  5815.   do: StartWavyTask(screen,1);
  5816.       WaitTOF(80); // wait however long you like, set vars, call functions, etc.
  5817.       StopWavyTask();
  5818.  
  5819.   In general we will want to use the WavyScreen effect in the above manner.
  5820.  
  5821.   But for Vodka spell I want the effect
  5822.   to last for the entire duration of the afflicted player's turn.
  5823.  
  5824.   I am not in "graphics design mode" right now so I leave the
  5825.   graphical design of the above spell to SAI.
  5826.   Here is roughly how it works.  You cast the spell on a player.
  5827.   This sets the appropriate wizard bit ala BattleCry etc.
  5828.  
  5829.   At the beginning of the afflicted person's movement phase we
  5830.   StartWavyTask(screen,2);
  5831.  
  5832.   If the drunkeness bit is set then all his creatures do only half
  5833.   damage.  (Just modify the combat routine to check for that bit and then
  5834.   >>1 the damage.)  At the end of his movement phase just StopWavyTask();
  5835.   and clear the drunkeness bit. VOILA! 8)
  5836.  
  5837.   This effect normally doesn't take many cpu cycles, however since we have
  5838.   2 visible screens on our display it probably slows down the computer
  5839.   noticeably.
  5840.  
  5841.   However it DEFINITELY does not slow down the computer any to wave a 64
  5842.   color screen instead of a 2 color screen.  Either way the screen waves
  5843.   instantly on command due to the power of the copper.
  5844.  
  5845. * Bless and Haste now utilize the WavyScreen effect. 
  5846.  
  5847. Doing the screenwave effect + the screenmelt effect simultaneously looks
  5848. extra gross in a horrific sort of way.
  5849.  
  5850. ????  I just edited the description of Arborist and saved it.  Then I did
  5851.   smake newspell.  But the game is still using the old description! 8(
  5852.   spells.tex has the new description but the game doesn't!
  5853.  
  5854. pool.ssc is dated June 30th, 1998.  This is August 24th.  pool.ssc hasn't
  5855. been updated all this time! 8(
  5856.  
  5857. In an attempt to fix above problem I threw the following lines into the
  5858. makefile: (SAI should look at the makefile to see if it is in correct order.)
  5859.  
  5860. pool.ssc: pool.txt sencode.o
  5861.     sencode <pool.txt
  5862.  
  5863. ok, that didn't work.  I'll leave this mysterious matter to SAI.  I just
  5864. don't know what all these different things do (sencode, decode, ae, ad,
  5865. single, fixfreq... AUGH!!! I guess I really broke something somewhere.)
  5866.  
  5867. SAI: ALLEGEDLY FIXED this problem.
  5868.  
  5869. Made various other changes to the makefile but no luck. 8(
  5870.  
  5871. Dear SAI: How about whipping us up a green square Image and a pink square
  5872. image so that we can show damaged movement on the info screen similar to
  5873. the way all the other stats are shown?  Thanx. (remember the colors on the
  5874. hires screen are different from the colors on the lores screen.)
  5875. SAI: Modified DrawSquares so you can use any HIRES screen colour that
  5876. you wish. DONE
  5877.  
  5878. * Reduced the probability of Bipedal Generators.
  5879.  
  5880. * Changed NOLOADORSAVE to be NOLOAD and removed the appropriate #ifdef NOLOAD
  5881.   references from the code.  This way the demo game can be played and
  5882.   saved.  Then when they get the registered version they will allegedly
  5883.   be able to load in their saved games and continue.
  5884.  
  5885. * FLAW: the 2nd menu strip (CONTROLS: Speech, Sound, Impurities etc.)
  5886.   does not highlight correctly.  This dates all the way back to v1.0
  5887.   FIXED.
  5888.  
  5889. * FLAW: Something about the game that has always really bothered me is
  5890.   that there was no way to know what turn it was.  Grrr...  When I play
  5891.   a long long game I have no idea how many turns I've played.  I like
  5892.   to know what turn it is so that I know about how many spells I have left
  5893.   and because sometimes I play a ridiculously hard game just to see how
  5894.   many turns I can survive.  FIXED. The turn # is now displayed on the
  5895.   Scores Screen.
  5896.  
  5897. * ADDED the saving of TurnCount into the header block of io.c  so now
  5898.   the Turn number is properly saved and loaded.
  5899.  
  5900. * BUG: I killed a Bird Lord with my mounted hourse and it was promoted to
  5901.   a Nightmare then immediately to an Iridium Horse.  FIXED.
  5902.  
  5903.   However, the IsDragon macros automatically report all mountable
  5904.   set 2 creatures as dragons.  Therefore you can promote a Thundermare
  5905.   by killing Bird Lords, T-Rexs or Elephants, as well as real dragons.
  5906.   SAI: I think this is acceptable.  
  5907.   JC: It's ok with me too.
  5908.  
  5909. Nothing of consequence done during september.
  5910.  
  5911. Absolutely, literally NOTHING done during October and November.
  5912. Too busy with work, fixing car, girls.
  5913.  
  5914. * Thanksgiving day playtesting.  Jerry, Joe and JJ learned the hard way
  5915.   that if player 1 casts an alliance spell on player 2 then player 3 casts
  5916.   an alliance spell on player 2 that the first alliance is severed.
  5917.   We never knew that it worked like that.  We should probably figure out
  5918.   some eloquent way of saying this in the spell description.
  5919.  
  5920. * Installed YAM1.3.5 for direct email contact between JJC and SAI.
  5921.   Hotmail has grown progressively worse ever since Bill Gates took it over.
  5922.   It just kept getting worse and worse until finally it just plain stopped
  5923.   working a few weeks ago.  I now use YAM for my "real" Email but my
  5924.   new permanent address is JamesConwell@yahoo.com
  5925.  
  5926. Since the makefile seems to change every time we swap the code around,
  5927. Maybe we should just forget about smake unarchive and just make a
  5928. fresh dir for the game each time we swap control and
  5929. "lha x" it then just do a "smake dev".  That will guaranteed work
  5930. so long as we don't forget to include any files in the archive.
  5931.  
  5932. * TESTED
  5933.   1. smake archive
  5934.   2. put the archive in a virgin dir and lha x #?
  5935.   3. smake dev
  5936.   WORKS ALMOST.  ALL FILES PRESENT AND ACCOUNTED FOR EXCEPT for
  5937.   fixfreq isn't getting recompiled by the makechaos file.
  5938.   I guess the dependencies are in reverse order or something.
  5939.   Leaving this for SAI to fix. NOW FIXED
  5940.  
  5941. * I just burned a floppy version of Chaos 2.3df and the disk is
  5942.   100% FULL.  Looks like I cut it real close.  Good thing I eliminated
  5943.   all that code and did all those optimizations.  Every little bit
  5944.   actually ended up making a difference.
  5945.  
  5946. * UPLOADED version 2.3d to Aminet.
  5947.  
  5948. December 1, 1998: ReleaseSemaphore(&SourceCode) by JJC
  5949. END OF VERSION 2.3
  5950. BEGIN  VERSION 2.4
  5951.  
  5952. * Fixed printf format bugs in sm.c, pool.tex.
  5953. * Made sm, reincalc, work under Unix.
  5954. * FIXED the problem with the generation of the "rein.h" file. I was
  5955.   deleting the file before it had a chance to be used. The program
  5956.   "reincalc" is only used to produce a table of reincarnation numbers
  5957.   for inclusion in the manual.
  5958. * FIXED type errors in decode.c, sencode.c, and graph.tex
  5959. * Stopped "graph.tex" from including inutition.h unnecessarily.
  5960. * Allegedly fixed menu recoverable error problem. This fix is not
  5961.   to my satisfaction and I will try and find a better solution. NOW FIXED
  5962. * Allegedly fixed the makefile problem with generating pool.ssc.
  5963. * REMOVED sound effect from BioHazard.spl (I don't feel this was
  5964.   necessary with the new screen effect).
  5965. * CHANGED: The eye-eye powerup now only gives 2 counts instead of
  5966.   5, but its effect can now be accumulated by casting the spell
  5967.   multiple times.
  5968. * Added MOUNTABLE2_STAT to the Shadow Dragon.
  5969. * Modified DrawSquares in info.c so that we can draw squares in any
  5970.   colour.
  5971. * Modified the movement and range stats to show the original value
  5972.   in red (i.e. like all the others stats) and the current value in
  5973.   green. I didn't do anything about recovery for movement.
  5974. * Added a few new random messages for wizard spell selection.
  5975.  
  5976. === Improvements to JC language ===
  5977.  
  5978. * ADDED support for DO_FOREVER loops to JC (replaces DO_WHILE(1))
  5979.  
  5980. * Added formatting for multiline /* comments. All such comments
  5981.   will now appear thus:
  5982.  
  5983. /*
  5984. blah blah blach ................................... black heep
  5985. toxic fumes kill wizard blah blah bvlah
  5986. */
  5987.  
  5988.   That is, the /* and */ appear on lines by themselves. The text
  5989.   in the comment is automatically word-wrapped at 75 characters
  5990.   (taken accounts of spaces of course). New paragraphs can be
  5991.   forced with two returns (as in most of our files). Finally,
  5992.   lines starting with * in a comment are passed through as is.
  5993.   This allows for lists to go through without formatting errors.
  5994.  
  5995.   I would have liked to indent the comment text a couple of spaces
  5996.   but I couldn't think of any easy way of doing this using my
  5997.   curret strategy.
  5998.  
  5999.   None of this affects /*-style comments on a single line.
  6000.  
  6001.   Someone still needs to do something with // style comments.
  6002.   I suggest that if // is the first thing on a line, then that
  6003.   line should be indented with the current indentation.
  6004.  
  6005.   I haven't test this on every file yet, so there might still
  6006.   be a few problems.
  6007.  
  6008. Note from JC:
  6009.   The above strategy has some unfortunate flaws.
  6010.   1. It destroys my "outline style comments"
  6011.   2. It destroys blocks of code which have been temporarily
  6012.      commented out.
  6013.   3. Most comments are already properly word-wrapped.
  6014.   4. You can word wrap a paragraph in Cygnus Ed Professional by simply
  6015.      placing the cursor at the start of the paragraph and selecting
  6016.      format from the menu.  You can format with or without fill.
  6017.  
  6018.   Therefore: I am changing it so that the auto word-wrapping
  6019.   ONLY happens on blocks of code that start with /**
  6020.   Hopefully that is good enough.  Perhaps we should make it /***** or
  6021.   something?
  6022.  
  6023.  
  6024. * NOTE FOR JAMES: NULL, 0, and '\0' are three diffrent concepts
  6025.   and it is just by chance (design?) that they have the same
  6026.   value on most platforms. I have used computers where NULL!=0
  6027.   (VAX 370 for instance). Futher NULL is a 32-bit quantity
  6028.   on the Amiga, whereas '\0' is only an eight bit quantity.
  6029.   More sophisticated compilers will complain about incorrect
  6030.   usage.
  6031.  
  6032.   Therefore please use NULL only for pointers and '\0' to
  6033.   mean the nul character. At the moment you often use 0 for
  6034.   this function. Further it is better to write '\n' than
  6035.   10 for end-of-line since code using 10 will fail under
  6036.   DOS, Cray, or Mac because of different line-ending
  6037.   conventions. Using '\n' should work for all platforms
  6038.   (POSIX standard).
  6039.  
  6040. * Added a few extra bits of code to JC-Lang so that it will work
  6041.   under a standard Unix environment. I needed this because I
  6042.   often test chaos stuff under Linux. A good reason for this
  6043.   is that make/gcc on Linux can churn through the entire
  6044.   spell-manager part of building in Chaos in under 15 seconds,
  6045.   yet this takes about 30 minutes on my Amiga.
  6046.   JC: You are racing a 1997 linux CPU against a 1987 Amiga CPU.
  6047.   The 68030 was introduced in 1987.
  6048.  
  6049. * I think we should completely phase TeX out of the source code
  6050.   now that we have a decent automatic formatter. ??
  6051.   JC: I don't care if we "phase TeX out" or not, but I would
  6052.   like it if you phased out the other .tex files so that all files
  6053.   are real code files.
  6054.  
  6055. * RENAMED: JCformat.jc to JCformat.c for Unix compatibility.
  6056.  
  6057. * ERROR: Just discovered Intuition defines a looping structure
  6058.   using FOREVER. Therefore I have renamed the JC equivalent
  6059.   to DO_FOREVER. If only the Intuition one had a { at the end
  6060.   of the definition all would have worked fine!
  6061.  
  6062. === end JC-Lang improvements ===
  6063.  
  6064. * Removed all .obe files from the game. Created .raw files for
  6065.   those .obe files which did not have .raw files. This saves
  6066.   a fair bit of space in the development directory, and archive
  6067.   file although makes no difference to the compiled program
  6068.   size.
  6069.  
  6070. * Modified the info panel so that creatures having the REIN
  6071.   bit set, show the number of reincarnations steps remaining
  6072.   in their sequence (previously just an `R' was shown).
  6073.  
  6074. === Start of input handler upgrade ===
  6075.  
  6076. * Completely rewrote HandleIDCMP with the aim of making it the
  6077.   sole place in the program to handle IDCMP events; although
  6078.   I have not yet incorporated the editor functionality into it.
  6079.   In the process I eliminated a few horrid global variables,
  6080.   I wish I could get rid of more of them.
  6081.  
  6082.   There should no longer be any menu selection problem.
  6083.   There should be less lossage of meaningful events.
  6084.   Return to end your turn now works much better.
  6085.   Various highlighting functions are more homogeneous.
  6086.   The mini-editor is still supported.
  6087.  
  6088. * Moved various bits of JC's timing code to the bottom of
  6089.   the chaos.c file since I didn't want them cluttering things
  6090.   up while I was doing the new logic.
  6091.  
  6092. * Hmmm. Discovered that the existing editing functions are
  6093.   already using some routines from chaos.c and now there
  6094.   is a conflict. Oh well, have temporarily turned those things
  6095.   off in the editor. NOW FIXED
  6096.  
  6097. * Incorporated the editor IDCMP handler into the main game
  6098.   handler, thus moving the one step closer to a single IDCMP
  6099.   handler. In addition this change shaved 500 bytes on the
  6100.   size of the code segment.
  6101.  
  6102. * Discovered I had accidently deleted the code for the `S' key.
  6103.   Reinstated it.
  6104.  
  6105. ====== End of IDCMP upgrade =========
  6106.  
  6107. * Modified the image tool to use only raw files. Took the
  6108.   opportunity to fix all the prototype error messages as well.
  6109.  
  6110. * Repaired the Quit option on the initialization screens.
  6111.  
  6112. WELL I'M OUT OF TIME. So back to JC.
  6113.  
  6114. NOTE: I haven't tested the modified JC formatter as much as
  6115. it should have been.
  6116.  
  6117. December 24th, 1998: ObtainSemaphore(&SourceCode) by JC:
  6118.  
  6119. unlha'ed the archive in a fresh dir and then did smake dev.
  6120. This produced a game that did not work due to no pool.ssc file having
  6121. ever been created.  Ok, I dug around and studied the fixfreq and sencode
  6122. and I understand what is going on now.
  6123.  
  6124. pool.ssc must be recreated when doing smake anything and pool.ssc does not
  6125.   already exist.
  6126. pool.ssc must be recreated when doing smake clean
  6127. pool.ssc must be recreated anytime that pool.txt is newer than pool.ssc
  6128.  
  6129. I'm not really sure exactly how this should be put into the makefile.
  6130. I just hacked something in and it didn't work.
  6131.  
  6132. Tried various different things and I just couldn't get a smake dev to
  6133. work from a freshly unarchived archive.  No matter what I tried some
  6134. mysterious thing wouldn't work.
  6135.  
  6136. I hate makefiles.
  6137.  
  6138. * FIXED various mangulated comments.
  6139.  
  6140. NOTICED: press a number key to highlight your creations. 
  6141. Press it again and nothing happens.  It used to unhighlight.
  6142. Is this good or bad?
  6143.  
  6144. * BUG: Press a number key to highlight your creations.  Press any Mouse
  6145.   Button. Menus no longer work.  This is due to all keys doing a
  6146.   TrapRMB with no corresponding PassRMB. NOW FIXED.
  6147.  
  6148. NOTICED: It always seemed like there was something missing from
  6149.      Classic Chaos.  I just figured out what it was.  I have now made
  6150.      Ropers and Wasp Nests CLASSIC.
  6151.  
  6152. * BUG: DO_FOREVER and LOOP aren't matching properly in jcformat.  FIXED.
  6153.  
  6154. * TESTED the latest jcformat on a couple of files.  Very minimal testing.
  6155.   seems ok.
  6156.  
  6157. * Added in medmod support to music.lib.  We can now easily play med (MMD0
  6158.   and MMD1) mods in Chaos.
  6159.  
  6160. * Added support for the QuadSpectrumAnalyzers into the medmod asm code.
  6161. * Added support for the Quadrascopes into the medmod asm code.
  6162.  
  6163. * Solved the mystery of converting period into samples per second
  6164. * Rewrote the quadrascopes to use the RIGHT formula now.
  6165. * Now the scopes really graph the part of the sample that is actually
  6166.   being played right that instant.  So now the scopes are accurate.
  6167.   You can really see the difference in speech samples such as "Chaos"
  6168.   where you can now see the peaks and valleys of the waveform as it is
  6169.   being played.
  6170. * Fixing the formula means that the scopes are now "locked in" to the music
  6171.   better.
  6172.  
  6173. * Implemented a 1000 entry lookup table to convert from the period value to
  6174.   samples per frame.  This saves 2 floating point divisions and 2 floating
  6175.   point multiplications each time a new note is started. But mainly it
  6176.   saves me the trouble of doing Floating Point math in asm.
  6177.  
  6178. * Tested all 6 game musics with the new system and they all work
  6179.   WONDERFULLY!
  6180.  
  6181. * Chaos now officially supports the playback of protracker and MED MMD0 and
  6182.   MMD1 mods.  If you have a choice then use MMD1.  Not that it really
  6183.   matters.  I have no idea which routine is faster, all I know is that MMD1
  6184.   mod format is superior to protracker mod format due to being able to handle
  6185.   more instruments and being able to have multiple songs per file.
  6186.   Hooray for Teijo Kinuunen!
  6187.  
  6188. Octamed Sound Studio Professional notes:
  6189. Octaves are 12, 23, 34, 45, 56, 67, 78, 89, 9A.
  6190. Octave 89 and 9A in OMSSP are illegal.  The notes are SUPER LOW.
  6191. Octaves 34 through 78 all sound the same
  6192.  
  6193.  
  6194. CHRISTMAS DAY PLAYTESTING:
  6195.  
  6196. * Designed a 4 player level with an exit in the middle, surrounded by walls.
  6197. 2 different versions.
  6198. 1. no generators
  6199. 2. 4 standard generators.
  6200.  
  6201. * ACK! BUG: smake release no longer works. I keep recompiling the program
  6202.   and it keeps telling me "unexpected end of file" and "semicolon expected"
  6203.   on the last blank line of the game.  Ok, traced this to a #ifdef
  6204.   DEVELOPER with no matching #endif.  NOW FIXED.
  6205.  
  6206. It took me a while to figure out the above bug so I was late and in a hurry
  6207. and I forgot to take the Level with me.  So we played a standard game of
  6208. James Vs. JJ with 20 scrolls, 4 generators, 4 artifacts and a 20 turn
  6209. limit.  This is the very first time that I (or JJ) has ever played with a
  6210. turn limit.  JJ started the game with 2 vanish spells.  He gained another
  6211. vanish after a few turns.  Plus he grabbed yet another vanish as a bonus
  6212. spell.  So I spent almost the entire game vanished with no creatures to
  6213. move or spells to cast.  Needless to say I lost.  The only possible bug to
  6214. report is that once I highlighted my creatures with "1" and then hit the
  6215. end of turn gadget and there was some strange noise during the computer
  6216. player's turn.  I don't really know if anything bad happened or not.  After
  6217. this the game continued normally.
  6218.  
  6219. * FLAW: Various snippets of level editor code are no longer undef'ed during
  6220.   smake release. NOW FIXED.  This saved 1048 bytes on the size of the
  6221.   release version.
  6222.  
  6223. * FLAW: Selecting "Load" from Setup Screen I produces some problems so I just
  6224.   quickly uncommented it for now. This saved 100 bytes on release version.
  6225.   As a general principle I believe that games should have a load option on
  6226.   the first main screen.  I'll just worry about it later because right this
  6227.   second I'm trying to nuke as many bugs as fast as possible.
  6228.  
  6229. * FLAW: exiting from reading a spell description makes a beep. FIXED
  6230.  
  6231. * BUSY WAITING LOOP?  When using cpr to track down the above bug I noticed
  6232.   something in HandleIDCMP.  The line of code that says:
  6233.   IF (Wait (HiResWindowWaitBit | windowWaitBit) & HiResWindowWaitBit) THEN
  6234.  
  6235.   never actually waited.  I traced over the code in cpr about 20 times and
  6236.   never once did it stop and wait for me to touch the mouse or keyboard.
  6237.  
  6238.   So I am thinking that somehow some sort of windowflag got messed up
  6239.   somewhere.  It has never done this before to me more than 2 or 3 loops.
  6240.  
  6241.   MYSTERY SOLVED: The trouble was that there is an ActivateWindow(window);
  6242.   call in the HandleIDCMP code now so I guess that as I pressed return on
  6243.   the line to execute the line, the window activates before I let off the
  6244.   return key. The strange thing is I am getting RAWKEY code 196 instead of
  6245.   68 like the return key is supposed to be.
  6246.  
  6247. * KEY RELEASE DETECTION mystery solved!  Codes 0 to 127 are key DOWN codes
  6248.   and 128 and up are key UP (RELEASE) codes.  So anytime a rawkey code is
  6249.   >128 just subtract 128 from it and you have the code that was released.
  6250.  
  6251.   But please note that keypresses do NOT neccessarily come in pairs of
  6252.   DOWN/UP codes.  If the user holds a key down then we are given a series
  6253.   of Key DOWN codes, one after the other, with no intervening UP codes.
  6254.  
  6255.  
  6256.   James Conwell's 10 Commandments  of Game Design:
  6257.   ================================================
  6258.  
  6259. Any game produced by James Conwell MUST have the following features:
  6260. 1. It must have an option for more than 1 human participant to play in a
  6261.    game.   I don't care what kind of game it is.  It MUST have at least
  6262.    a 2-player option.
  6263.  
  6264. 2. It must have a 1 player option.
  6265.  
  6266. 3. It should have an option for 2 player competitive as well as 2 player
  6267.    cooperative.  2 player cooperative mode is VERY important!!!!
  6268.  
  6269. 4. It must have awesome music.
  6270.  
  6271. 5. It must have a wide variety of awesome music, probably including but not
  6272.    neccessarily limited to the following:
  6273.    A. Spooky Music.
  6274.    B. Rave Techno.
  6275.    C. Straight Dance.
  6276.    D. Dramatic Music.
  6277.  
  6278. 6. It must have an intro that can be IMMEDIATELY exited at any time.
  6279.  
  6280. 7. It must make good use of the capabilities of the format that it
  6281.    is presented in/on.
  6282.  
  6283. 8. It must be FUN to play.
  6284.  
  6285. 9. We must go through the game and take out everything about it that is
  6286.    annoying and either remove it or make it optional.
  6287.  
  6288. 10. It must have good graphics.
  6289.  
  6290.  
  6291.  
  6292. The only way I know to stop the flicker of the pentagrams is to either:
  6293. A: Figure out a way to do double-buffering that really works.
  6294. B: Move the pentagrams to the bottom of the screen. (this is just a work
  6295.    around)
  6296. C: Make the game require OS 3.0 and use those double-buffering routines.
  6297.  
  6298.  
  6299. * INVESTIGATED the following examples of double buffering from Aminet.
  6300.   These are all that I could find:
  6301.  
  6302. dbuffer.lha        dev/e        3K  95+Easy double buffering of screens
  6303. DBuff.lzh          dev/src     12K 321+double buffering demo w/source
  6304. doublbuf.lha       dev/src      7K 171+Eg. of fast OS-friendly double buffering    
  6305. NBuff.lha          dev/src     19K 277+Double bufferung routines example. V2.2
  6306.  
  6307. All these examples SUCK because:
  6308. 1. They don't allocate  their bitmaps properly.  They use that icky
  6309.    scatterload approach.
  6310. 2. They use the slow RethinkDisplay(); technique.
  6311. 3. The ones that don't use RethinkDisplay(); require OS 3.0+.  And since I
  6312.    am making the game compatible with all OS's it is useless to me.
  6313.  
  6314. * DOUBLE-BUFFERING of rastports/bitmaps implemented for pentagrams
  6315.   (finally!).  Now they are rock solid, _except_ for during high CPU load
  6316.   times (like while downloading from the internet on standard serial port)
  6317.   During high cpu load they flicker a bit sometimes.
  6318.   I haven't tested it on A500 yet.
  6319.  
  6320. **************************************************************************
  6321. *******                ADPCM asm routines upgrade                  *******
  6322. **************************************************************************
  6323.  
  6324. ADPCM stands for Advanced Delta Pulse Code Modulation.
  6325.  
  6326. It is a lossy compression algorythm which is supported by the Zyxel Voice
  6327. modems and various voicemail packages.
  6328.  
  6329. I intend to use ADPCM audio compression technology to reduce the storage
  6330. requirements of the speech samples of Chaos.  This is useful for persons
  6331. such as SAI who have limited hard drive space.
  6332.  
  6333. I do not intend to compress the "sound effects" of the game.  Only the
  6334. speech samples because there are going to be hundreds of speech samples.
  6335. The game will soon have about 10 megs of uncompressed speech which will
  6336. be only 2.5 megs compressed.
  6337.  
  6338. ADPCM3 is the 3-bit algorythm.  It compresses sound to an 8:3 ratio.
  6339. ADPCM2 is the 2-bit algorythm.  It compresses sound to a  4:1 ratio.
  6340.  
  6341. ADPCM3 produces better sound quality but at the expense of taking a lot
  6342. more CPU cycles to do it.
  6343.  
  6344. ADPCM2 sounds noticeably worse than a standard Amiga sound sample but
  6345. speech samples still sound MANY times better than the algorythmically
  6346. generated speech of translator.library.
  6347.  
  6348. I have NO intention of using ADPCM3 compressed sound in Chaos.
  6349. If you want sound quality then don't compress.
  6350. If you want small size then compress with ADPCM2.
  6351. So there is no need to use ADPCM3.  I'm just including it for orthogonality
  6352. and because the routine is so small.
  6353.  
  6354. The beginning of this upgrade starts with Christian Buchner's
  6355. asm coded ADPCM routines as a starting point.
  6356.  
  6357. I will optimize them for maximum speed.
  6358.  
  6359. * ADPCM2_Decrunch routine
  6360.  
  6361.   REVISION 1+2 combined together:
  6362.   For every byte that gets decompressed James Conwell has:
  6363.   1. Eliminated 6 instructions and
  6364.   2. Replaced 4 slow instructions with 4 fast ones and
  6365.   3. Eliminated 4 bus accesses. (*Very* important on A1200 with no Fast Ram) and
  6366.   4. Eliminated 3 bus accesses for every 4 bytes written.
  6367.  
  6368.   ACK!  I just realized that my main loop is 256 bytes long!
  6369.   due to the 16-byte cacheline properties of the 020 and 030 this
  6370.   will almost NEVER fit into the cache.  In order to make sure your code
  6371.   fits in the cache you must keep your main loop down to 240 bytes!
  6372.   My next revision of this routine will fix this.
  6373.  
  6374.   REVISION 3:
  6375.   Main loop now takes only 194 bytes.
  6376.   Saved 14 cycles per decompressed byte on 68000.
  6377.   Saved  6 cycles per decompressed byte on 68030.
  6378.  
  6379.   REVISION 4: was a failure.
  6380.   I attempted to replace the multiply,add,asl instruction set with a
  6381.   256 entry lookup table.  Since the variable having all the math done
  6382.   on it is the delta and since a sample is only 1 byte big, I figured the
  6383.   largest delta one could possibly generate would be 255.  So I'd have
  6384.   a nice little table of 256 words which would save me 78 cycles per
  6385.   decompressed byte.
  6386.   Hours later... it didn't work... after investigation it turns out that
  6387.   the delta is unboundedly large.  I ran 2 sound samples through the
  6388.   algorythm and the delta reached a maximum of 15944!!!  Ack.
  6389.   Stupid algorythm.
  6390.  
  6391.   Current Standing:
  6392.   The main loop takes 212 cycles.
  6393.   So on my standard 22,000 samples per second sounds it will take
  6394.   4,664,000 cycles per second on an M68000.  That is 65% of all available
  6395.   CPU power just to decompress the audio stream!
  6396.  
  6397.   REVISION 5:
  6398.   Ok I figured out how to use the table or do the math the slow way
  6399.   depending on the size of the delta.
  6400.   During a quiet sound sample this allows me to save an average of 62
  6401.   cycles per decompressed byte.
  6402.   During a noisy sound sample this allows me to save an average of 54.1
  6403.   cycles per decompressed byte. (save 62 cycles 93.2% of the time, waste
  6404.   54 cycles 6.8% of the time)
  6405.  
  6406.   I Strategically layed out the code for maximum speed and minumum size.
  6407.  
  6408.   This is what I love about coding for the 020 and 030;  their 256 byte
  6409.   on-board L1 Cache.  It makes the geographic layout of your code very
  6410.   important. You must strategically lay out all your branches because
  6411.   their geographic location in the code is important.  Its TOTALLY COOL.
  6412.   Asm programming is the ultimate strategy game!
  6413.  
  6414.   Current Standing:
  6415.   The main loop takes an average of 157.89 cycles during a noisy part
  6416.   of a sound sample.
  6417.   So on my standard 22,000 samples per second sounds it will take
  6418.   3,473,536 cycles per second on an M68000.  That is 48.5% of all available
  6419.   CPU power just to decompress the audio stream!
  6420.  
  6421.   This algorythm cries out for the power of the 020's barrel shifter
  6422.   and faster mulu instruction.
  6423.  
  6424.   I can make an optimized version of this routine for 020+ by replacing
  6425.   all those add.w d2,d2 commands with the 020+ SCALED index addressing
  6426.   mode.  Such a routine would REQUIRE an 020+ to run.
  6427.  
  6428.   DRAT!  I was all ready to declare this routine "FINISHED" but
  6429.   unfortunately my main loop is 248 bytes!  It will only fit into the
  6430.   020/030 cache half of the time! 8(
  6431.  
  6432.   I will now make 2 slightly different versions of this routine.
  6433.   _000 for 68000
  6434.      This routine unchanged.
  6435.      This routine writes its data to chipram a longword at a time. (4 bytes)
  6436.      This routine runs on any M680x0 series processor.
  6437.  
  6438.   _020 for 68020 and up
  6439.      This routine with all the add.w d2,d2 replaced with the *SCALE
  6440.      addressing mode.  This will only speed things up by 2 cycles on 030
  6441.      so the main reason for using *SCALE is to reduce the main loop size
  6442.      by 16 bytes from 248 down to 232 so that the main loop will ALWAYS
  6443.      fit into the onboard L1 cache.
  6444.      This routine writes its data to chipram a longword at a time. (4 bytes)
  6445.      This routine REQUIRES an M68020 or higher processor.
  6446.  
  6447.   NOTE: I have coded many asm routines for use with many C and Basic
  6448.   programs but this is the very first time I made 2 different versions of
  6449.   the same routine.  Usually I didn't need to make 2 different versions
  6450.   due to there not being any advantage to doing so.  On a few occassions
  6451.   I could have made 2 or 3 different versions optimized for different
  6452.   processors but it wasn't important enough to bother.
  6453.  
  6454.   OOPS I just figured out another optimization to save 4 cycles in the main
  6455.   loop.  I replaced btst #1,d1 (10 cycles) with btst d7,d1 (6 cycles)
  6456.  
  6457.   Combined with earlier speedups,
  6458.   during a noisy sound sample this allows me to save an average of 57.56
  6459.   cycles per decompressed byte. (save 66 cycles 93.2% of the time, waste
  6460.   58 cycles 6.8% of the time)  This optimization also saved another 6 bytes
  6461.   in the main loop
  6462.  
  6463.   FINAL STANDING
  6464.   The main loop takes an average of 154.432 cycles during a noisy part
  6465.   of a sound sample.
  6466.   So on my standard 22,000 samples per second sounds it will take
  6467.   3,397,504 cycles per second on an M68000.  That is 47.46% of all available
  6468.   CPU power just to decompress the audio stream!
  6469.  
  6470. * ADPCM3_Routine: Ok I rewrote this routine several times and kept speeding
  6471.   it up.  Eventually I got to a point where I can do something radical that
  6472.   the Motorola book says will be faster on 000 - 040 but I didn't trust it
  6473.   so I wrote the routine 2 different ways and was then going to race them.
  6474.   I copy & pasted the timing code from Chaos into the adpcm routine but
  6475.   all it did was give me total GARBAGE results that had nothing to do with
  6476.   anything.  That timer() routine is just useless. 8(
  6477.  
  6478. ALL ADPCM routines still need more work and are on hold until I can time
  6479. the various methods.
  6480.  
  6481. **************************************************************************
  6482. *******       END of ADPCM Asm Routines Upgrade for now            *******
  6483. **************************************************************************
  6484.  
  6485.  
  6486.  
  6487. January 6th, 1999: I've now been working on Chaos for 2 years.
  6488. A lot was accomplished this year but not nearly enough for my tastes.
  6489. Due to the demands of trying to design the world's best strategy game and
  6490. work a day job I just didn't get enough done.  I'm very dissatisified that
  6491. I still haven't got the music and digital sound effects upgrade installed,
  6492. even though this is actually the very first thing I wanted to do 2 years ago.
  6493.  
  6494. STATUS REPORT:
  6495. There are 132 creatures in the game.
  6496. There are 128 Magic spells
  6497. There are  37 inanimate objects
  6498. There are   7 growths
  6499. There are 304 items total.
  6500.  
  6501. The main program for v2.3d is 366536
  6502. chaos.dat is 66368
  6503. Archive size is 500k.
  6504.  
  6505. * PRIVATE functions instead of static.  Using the word "static" to mean
  6506.   "private" just doesn't make sense to me.  So JC now supports the use
  6507.   of the keyword PRIVATE for making a function private to a particular
  6508.   file.
  6509.  
  6510. * Put in a Vblank_Counter variable into animatorasm that gets incremented
  6511.   once each vblank so I have a reliable method of timing things.  Obviously
  6512.   there will be tremendous roundoff error on timing small things but it will
  6513.   be ok for long operations.
  6514.  
  6515. * NEW Asm routines: TestPixel4_320, TestPixel1_320, TestPixel4_640 and
  6516.   Test_Pixel1_640.  We no longer use the old TestPixel4 and TestPixel1
  6517.   routines.  We now use these new faster routines.  Since we only use
  6518.   rastports of 640 or 320 pixels width I made these routines take advantage
  6519.   of that fact.  These new routines are 58 cycles faster on 68000.
  6520.   The old routines are still available in case we ever need to use them on
  6521.   a strangely shaped bitmap/rastport.
  6522.  
  6523. * New global variables LoResBitPlane and HiResBitPlane.  These are pointers
  6524.   to the first byte of the first bitplane of the LoRes/HiRes screens.
  6525.   This is a pointer to the actual data, NOT a bitmap structure.
  6526.   These pointers are required for the new TestPixel routines because the
  6527.   new routines don't take a pointer to a rastport struct as a parameter,
  6528.   instead they take a pointer to the first byte of actual data of the
  6529.   first bitplane.
  6530.  
  6531. Timing Results for 1 million calls on 25Mhz 68030
  6532. Times measured in Frames.  (There are 50 frames per second)
  6533.                OS ReadPixel  TestPixel4_320  TestPixel1_320
  6534. Frames             2970         398             291
  6535. Calls/frame         336.7      2512.6           3436.4
  6536. Speed Increase        1x          7.46x           10.2x
  6537.  
  6538.  
  6539. Timing Results for 1 million calls on 7.15909 Mhz 68000
  6540. Tested on A2000 with 1 meg chip + 8 megs fast ram.
  6541. 126 frames to do nothing; this is subtracted from the results.
  6542.                OS ReadPixel  TestPixel4_320  TestPixel1_320
  6543. Frames             8272        2070             1577
  6544. Calls/frame         120.9       483.1            634.1
  6545. Speed Increase        1x          4x             5.25x
  6546.  
  6547.  
  6548.  
  6549. ADPCM process/task will
  6550. 1. Use right channel.  So that the left channel of algorythmic audio can
  6551.    play simultaneously if needed.
  6552. 2. CTRL-C means to Cancel (abort) playback of the audio.  The adpcm task
  6553.    aborts its current playback (if any) and then waits for more commands.
  6554. 3. CTRL-D means DIE.  Kill the task at the end of the game.
  6555. 4. CTRL-E to start play back.  Set up some variables then send the
  6556.    Chaos_ADPCM_Task a ctrl-e and it will start playing the specified file.
  6557. 5. If the Chaos_ADPCM_Task should ever stop playing for any reason then
  6558.    it will send the main task a CTRL-F (F=Finished).
  6559.    It doesn't matter _why_ it stopped playing.  If it stops playing for any
  6560.    reason it signals that it is finished with CTRL-F.
  6561.    So if the sound sample has completed playback, or it couldn't get the
  6562.    audio channel allocated or it couldn't find the file or the file had a
  6563.    read/write error or the task was told to stop with CTRL-C, then it signals
  6564.    a CTRL-F back to the main task right before it begins waiting for the
  6565.    next command.
  6566.  
  6567.  
  6568. 68030 timings Using supermegainline version of ADPCM3 decrunch
  6569. Main loop is much larger than 256 bytes.
  6570.  17956 ADPCM_000.lib          JC
  6571. Filesize Filename           Frames
  6572.  19585 LetsPlayChaos.adpcm3   15
  6573.  13060 LetsPlayChaos.adpcm2    8
  6574.  
  6575. 195100 ChaosRules.adpcm3     157
  6576. 130070 ChaosRules.adpcm2      78
  6577.  
  6578.  17484 ADPCM_020.lib  with a routine that fits into the 256 byte cache
  6579.  19585 LetsPlayChaos.adpcm3   13
  6580.  
  6581. 195100 ChaosRules.adpcm3     128  18.5% faster
  6582.  
  6583. So even though the megainlined version saves 2 instructions (bsr/rts) for
  6584. each byte decompressed, we still lose speed overall because the main loop
  6585. becomes so big that it won't fit into the cache of the 020/030.
  6586.  
  6587. According to the timing charts the megainlined version should have been
  6588. faster on all CPUs.
  6589.  
  6590. * I made 2 versions.  1 optiminzed for 000 and one optimized for 020.
  6591.   ADPCM_000.lib and ADPCM_020.lib
  6592.  
  6593. * NOTE about OS compatibility: If the game were ever to require OS 2.04
  6594.   or higher (which I assume it will when we make the game internet-capable)
  6595.   then we can replace all occurences of CreatePort with CreateMsgPort
  6596.   and all occurrences of DeletePort with DeleteMsgPort and all occurrences
  6597.   of CreateExtIO with CreateIORequest and all occurrences of DeleteExtIO
  6598.   with DeleteIORequest then we could stop linking with amiga.lib and
  6599.   hopefully save some bytes on the executable filesize.
  6600.  
  6601. * MAKEFILE improved with new options: demo_020, release_020 and
  6602.   releasewithleveleditor_020.  These options compile all JC code using
  6603.   68020 instructions and optimizations and link with the 020 version
  6604.   of ADPCM lib.  This way all low end users will get a version of the game
  6605.   that makes MAXIMUM use of their limited processing power.
  6606.  
  6607. smake demo_020 produces a filesize of 338360
  6608. smake demo     produces a filesize of 342312
  6609.  
  6610. * STRANGE: On December 25th, 1998  the filesize of the demo was 366536.
  6611.   Since then I've added about 1k of asm code, 500 lines of JC code and
  6612.   about 18k of lookup tables yet somehow the filesize has SHRUNK by 24k!
  6613.   The only thing I can figure is I must have forgot to do a smake clean
  6614.   before doing smake demo on Christmas day, thus I was using unoptimized
  6615.   code.
  6616.  
  6617.                        ADPCM DECRUNCH ROUTINES
  6618.                   Christian Buchner vs. James Conwell
  6619.      Using the current versions of the routines on January 16th, 1999
  6620.  
  6621. On all timing tests the display mode is the standard Chaos split screen
  6622. 320x256x5 bitplanes and 640x256x3 bitplanes.
  6623.  
  6624. 68000 with 8 megs fast and 1 meg chip.
  6625.                               CB     JC
  6626. Filesize Filename           Frames Frames
  6627.  19585 LetsPlayChaos.adpcm3  152    101  1.5x faster
  6628.  13060 LetsPlayChaos.adpcm2  134     61  2.2x faster
  6629.  
  6630.  
  6631. 68030 with 12 megs fast and 2 megs chip.
  6632.  19585 LetsPlayChaos.adpcm3   17     13
  6633.  13060 LetsPlayChaos.adpcm2   15      8
  6634.  
  6635.  195100 ChaosRules.adpcm3    165    128  1.3x faster
  6636.  130070 ChaosRules.adpcm2    152     76  2x faster exactly
  6637.  
  6638.  
  6639.  
  6640. There wasn't enough chipram available to easily test the "Chaos Rules" 500k
  6641. sample on my 68000 based amiga so I just skipped it.
  6642.  
  6643. * TESTED the adpcm3 playback routine on 26.5 Khz sound samples from a floppy
  6644.   drive on my 25Mhz 030.  WORKS PERFECTLY.  No skipping.  It plays the samples
  6645.   back straight off the floppy using double-buffering.
  6646.  
  6647. * TESTED the adpcm3 playback routine on 26.5 Khz sound samples from a floppy
  6648.   drive on my 7Mhz 000.  SERIOUS buffer underflow.  The routine would need to
  6649.   be at least twice as fast as it currently is to work on the 7Mhz 68000.
  6650.   Even if I put in the 24k lookup table + all my other tricks I can't make
  6651.   it go twice as fast as it already is.
  6652.  
  6653. * TESTED the adpcm2 playback routine on 26.5 Khz sound samples from a floppy
  6654.   drive on my 7Mhz 000.  Small amounts of buffer underflow for each buffer.
  6655.   So that a long sound sample skips a bit here and there or crackles.
  6656.   Sometimes the head has to seek to the next part of the file and there is a
  6657.   BIG skip. 8(  Hopefully all will be fine once I cut the sampling rate in
  6658.   half to 11Khz for the floppy disk version.  The hard drive version will
  6659.   still use the 22Khz sounds.
  6660.  
  6661.   It would really help if the floppy version could use a fast file system
  6662.   floppy.  But, alas, that requires OS 2.04 or higher.
  6663.  
  6664. * BUG in my 8svx datatype.  I squished my sound samples down to 11k but
  6665.   now x2adpcm can't convert it due to a silly bug in the 8svx datatype.
  6666.   So all my sound upgrading is on hold till I get a new internet account
  6667.   and download the latest version of the 8svx datatype.
  6668.  
  6669. * Sent off for a new internet account on January 16th, 1999.  It costs
  6670.   $240.00 for 1 year and has dialups all over the USA and Canada.
  6671.  
  6672. * Changed wizard names to names that actually mean something to me.
  6673.   This makes the game a lot more fun for me.
  6674.  
  6675. SETBACK: I can't get the fake seglist code from the RKRM manual to work.
  6676. I just get strange problems.  So my new Chaos_ADPCM_Process won't work.
  6677. I must either wait to get my new internet account to find out what's going
  6678. on or I must really load the code off of disk and communicate to it with
  6679. messages instead of just signals like I am doing currently.
  6680. I own many Amiga programming books but none of them explains how to create
  6681. a process using some code that is already in your program.  This
  6682. information might be in the AmigaDOS Developers book but I don't have that.
  6683.  
  6684.  
  6685. Dear SAI: I really hate the bipedal generators in their current form.
  6686. So we should do one of the following:
  6687. A) Set bipedal generators to generate at the same frequency as standard
  6688.    generators.
  6689. B) Have yet another setup screen that appears when Generators>0
  6690.    that allows us to turn on/off which types of generators we will
  6691.    get.  A "Generators Setup Screen".
  6692.  
  6693. I prefer option A simply because its the least work while making the game
  6694. meet my wants.  If you don't like option A then we'll have to do option B.
  6695.  
  6696. * CHANGED: Bipedal Generators to generate at the same rate as Aviaries.
  6697.  
  6698. PROBLEM: The pearl.font isn't being used in the game when I play it
  6699. on my OS 1.3 amiga.  ??????????????????
  6700. Ok, I made some changes.  Maybe this is fixed now.
  6701.  
  6702.  
  6703. * James opens a can of "WHOOP ASS".
  6704. * James guggles down the whole thing.
  6705. * James rewrites line of sight testing to be 9x faster than present,
  6706.   21x faster than it was originally. Boring details follow:
  6707.  
  6708. *******************  LINE OF SIGHT SPEEDUP UPGRADE *******************
  6709.  
  6710. Timing test of line of sight routine on a clear board with a wizard
  6711. in each corner pressing the L key. The animator task is stopped but the
  6712. color cycler task is running at full speed.
  6713.  
  6714.                   68030        68000
  6715. Bottom Left  Corner: 26 frames 181
  6716. Bottom Right Corner: 28 frames 181
  6717. Upper  Left  Corner: 27 frames 180
  6718. Upper  Right Corner: 27 frames 180
  6719.  
  6720. I massaged the C code a bit to use WORDS instead of ints but this actually
  6721. made it 4 frames slower! (?)  Put it all back to ints.
  6722.  
  6723. C optimization 1.: saved 1 frame on 030.
  6724. Every corner now   : 25 frames
  6725.  
  6726. C lookup table implemented:
  6727.  
  6728.                   68030        68000
  6729. Bottom Left  Corner: 12 frames  92
  6730. Bottom Right Corner: 12 frames  92
  6731. Upper  Left  Corner: 12 frames  90
  6732. Upper  Right Corner: 12 frames  90
  6733.                    2.25x        2x times faster
  6734.  
  6735. C optimization 2.
  6736.                   68030        68000
  6737. Bottom Left  Corner: 10 frames  ?? 
  6738. Bottom Right Corner: 10 frames  
  6739. Upper  Left  Corner: 10 frames  
  6740. Upper  Right Corner: 10 frames  
  6741.                    2.7x
  6742.  
  6743. C optimization 3. (optimized AutoAccept())
  6744.                   68030        68000
  6745. Bottom Left  Corner:  8 frames  ??
  6746. Bottom Right Corner:  8 frames  
  6747. Upper  Left  Corner:  8 frames  
  6748. Upper  Right Corner:  8 frames  
  6749.                    3.37x
  6750.  
  6751. C optimization 4. (precalc all AutoAccept())
  6752.                   68030        68000
  6753. Bottom Left  Corner:  7 frames  68
  6754. Bottom Right Corner:  7 frames  68
  6755. Upper  Left  Corner:  7 frames  68
  6756. Upper  Right Corner:  7 frames  68
  6757.                    3.85x         2.65x times faster
  6758.  
  6759. Now I will rewrite the inner loops in optimized assembly language.
  6760.                   68030        68000
  6761. Bottom Left  Corner:  3 frames  27
  6762. Bottom Right Corner:  3 frames  27
  6763. Upper  Left  Corner:  3 frames  27
  6764. Upper  Right Corner:  3 frames  27
  6765.                      9x       6.66x times faster
  6766.  
  6767. Added special optimized code for handling straight lines and 45 degree angles.
  6768.                   68030        68000
  6769. Bottom Left  Corner:  3 frames  24
  6770. Bottom Right Corner:  3 frames  24
  6771. Upper  Left  Corner:  3 frames  24
  6772. Upper  Right Corner:  3 frames  24
  6773.                       9x       7.5x times faster
  6774.  
  6775. C COMPILER BUG: a line like this screws everything up and reports bogus
  6776. errors:
  6777. ELSE // up to left \
  6778.  
  6779.  
  6780. Absorbed isLineOfSightTestQ into isLineOfSightQ
  6781.                   68030        68000
  6782. Bottom Left  Corner:  3 frames  23
  6783. Bottom Right Corner:  3 frames  23
  6784. Upper  Left  Corner:  3 frames  23
  6785. Upper  Right Corner:  3 frames  23
  6786.                       9x       7.8x times faster
  6787.  
  6788. If I was completely psychotic I could save 1 last frame on the 68000
  6789. version only.
  6790.  
  6791. Just for fun I went back and put in the original line of sight testing
  6792. code from v1.7 (this is before I put in those optimizations in 1997)
  6793.                   68030        68000
  6794. Bottom Left  Corner: 63 frames  392
  6795. Bottom Right Corner: 63 frames  392
  6796. Upper  Left  Corner: 64 frames  390
  6797. Upper  Right Corner: 63 frames  392
  6798.                      21x         17x times faster
  6799.  
  6800. ******************** END LINE OF SIGHT SPEEDUP UPGRADE *******************
  6801.  
  6802. * Made algorythmic sound effects allocate/deallocate the sound channel.
  6803.   Now that it no longer hogs a sound channel at max priority I can add
  6804.   ingame music.
  6805.  
  6806. Tuesday, Jan. 26th.  Melissa and Mike got busted/bluffed by mike's wife
  6807. for cheating on her. Lots of crap.  No work accomplished.
  6808.  
  6809. * CLASSIC: Ogre Mage, Standard Wall, Weak Wall, Rock, Speed and Slow
  6810.   are now CLASSIC.
  6811.  
  6812. * CHANGED: Impurities and Agent Casting can no longer be set using the
  6813.   ingame menus.  I had to do this to pave the way for the internet upgrade.
  6814.   We can only allow the user to change settings during the game which do
  6815.   not materially affect gameplay.  Things which materially affect gameplay
  6816.   must be set _once_ at the beginning of the game and then remain unchanged
  6817.   for the duration of that game.  Replaced MENUImpure and MENUAgents with
  6818.   the global variables "Impurities" and "AgentCasting".
  6819.   At some point I'll use the empty space for music and sound effects
  6820.   options.
  6821.  
  6822. * Placed Impurities and AgentCasting on setup screen and in savegame file.
  6823.   This means the savegame format has changed so previously saved games
  6824.   will no longer load correctly. Tested and verified, I loaded an old
  6825.   savegame and the whole game locked up but at least the computer didn't crash.
  6826.  
  6827. * FLAW: (at least I assume this is a flaw).  I had a stone giant stand on
  6828.   top of a dead stone golem.  Each turn the computer players would justice
  6829.   or dark power my Stone Giant and it would be reinstated as a stone golem.
  6830.   then the next player would justice my new stone golem and it would go
  6831.   back to being a Stone Giant. ad infinitum.  This is caused by the fact
  6832.   that justice and dark power leave corpses behind when in previous versions
  6833.   they did not.  Anyway I changed it so that Justice/DarkPower/Exorcise/etc.
  6834.   do not leave corpses behind anymore.  FIXED and TESTED.
  6835.  
  6836. * BUG: C for CAST does not work on the second Justice/DarkPower/speed/slow
  6837.   etc. (any multiplicity spell I guess.)   Strangely, the C key works for
  6838.   Shadow Woods and other trees.  Ok, I traced this to a problem in the
  6839.   spell files where the target of the spell is highlighted with the
  6840.   highlight sprite.  The C key uses the position of the HighLight Sprite
  6841.   for determination of who the caster is.  This information was being
  6842.   lost.  NOW FIXED in every spell file.
  6843.  
  6844. It would be really nice if we could position wizards with cut and paste
  6845. in the level editor.  We could then design multiplayer levels much more
  6846. easily.  This is something both Joseph and James have been wanting.
  6847. Leaving this for SAI.
  6848. SAI: The editor now has fragile support for this.
  6849.  
  6850. * The turn number is now displayed on the New Game and Quit Game requesters.
  6851.  
  6852. I've wasted quite a bit of time the last few weeks due to trying to
  6853. maintain OS 1.3 compatability.  I've had major problems which are still
  6854. not solved with the ADPCM process.  I think
  6855. that if I was using OS 2.04+ routines that these problems would simply
  6856. not exist.  Therefore there is a very real possibility that I will
  6857. make the game require OS 2.04+ very soon.
  6858.  
  6859. * Disrupt no longer kills scrolls + I added the following sentence to the
  6860.   description:  "This spell currently does not affect wizards, growths,
  6861.   inanimate objects or scrolls."
  6862.  
  6863. * various changes to docs.
  6864.  
  6865. * Feb 8th, 1999: Downloaded the latest 8svx and sound datatypes.
  6866.   Downloaded the ZXAM20b.lha emulator from aminet.
  6867.  
  6868. * FLAW: At beginning of Spell Selection phase there is still text left over
  6869.   at the bottom from the movement phase. FIXED.
  6870.  
  6871. * LIST PROCESSING implemented for the sentence generation of what wizards
  6872.   say during their spell selection.  There are now around 20x as many things
  6873.   that they can say without taking 20x the memory.  It's extremely easy to
  6874.   edit the TalkLists file and add new stuff in, you don't even have to
  6875.   recompile!  I took this code from a True Basic paragraph generator that I
  6876.   made a few years ago.  Only I didn't bother to translate all the paragraph
  6877.   stuff.  Just the 1-line sentence generation and list processing stuff.
  6878.  
  6879. * WriteNearBottom can now handle 2 lines of text.
  6880.  
  6881. * BUG: a computer wizard cast Alliance but then didn't actually cast it on
  6882.   anyone.  Or at least he didn't get any allies by casting it.  This has now
  6883.   happened 10 to 12 times. When playing a game with no generators the
  6884.   Alliance spell always works.  The problem is that the computer wizards
  6885.   always try to ally themselves with the Independents when independents are
  6886.   available but the spell is programmed to fail when applied to an Independent
  6887.   creature. NOW FIXED.
  6888.  
  6889. * ADDED New CastInfo bits: CAST_NOINDEPENDENTS and CAST_NOASLEEP so that it
  6890.   it is illegal to cast Alliance on independent or sleeping creatures.
  6891.   It is now illegal to cast sleep on sleeping creatures too. This will help
  6892.   prevent the computer players from doing stupid stuff.
  6893.  
  6894. * CHANGED: CAST_UNDEAD to CAST_MUSTBEUNDEAD.
  6895.  
  6896. BUG:  If you select "quit" from the menu and then click the checkmark then
  6897. some enforcer hits are generated.  When I run the game under CPR, the game
  6898. simply locks up and does not quit.  Note to SAI:  Does any of this happen
  6899. on your system?  Note from JC:  I fixed this bug months later on October
  6900. 21st, 1999.
  6901.  
  6902. * BROKEN: Aviaries, Dragon Nests and Bipedal Generators never generate
  6903.   anything anymore 8(  (at least not when playing with 8 wizards.)
  6904.   I just played a test game against 8 wizards and 4 generators and the
  6905.   generators NEVER generated anything.  Ok, this is because I had
  6906.   AgentCasting turned off.  I have NOW FIXED this so that even with
  6907.   AgentCasting off, the generator agents still generate.
  6908.  
  6909. * MAJOR BUG: A computer wizard just attacked his own elephant!  This might
  6910.   be because he was beside it and was "engaged" to it or perhaps he tried to
  6911.   mount it?  Lucky for him his elephant didn't attack him back, it charged
  6912.   toward the nearest enemy instead.  The bug was in ChooseDestination().
  6913.   NOW FIXED.
  6914.  
  6915. * BUG: Computer Wizards keep trying to mount meditations which are already
  6916.   occupied. NOW FIXED.
  6917.  
  6918. * BUG: A computer Wizard just cast Animate on turn 1 and then nothing
  6919.   happened.  It didn't say what he cast it on.  It didn't say he aborted it.
  6920.   OK, he didn't have any inanimate objects so "nothing" is exactly what was
  6921.   supposed to happen.  I modified isStupidCast to check for this but
  6922.   I have NO idea if my player number is correct or off by one.
  6923.   NEVER MIND: I have eliminated the "player" parameter from isStupidCast.
  6924.   It now gets its player information directly from CasterCell, thus permanently
  6925.   and forever solving the off by 1 player number problem for this routine.
  6926.   NOW FIXED.
  6927.  
  6928. * BUG: Computer wizards routinely waste Subversion type spells on creatures
  6929.   which are being ridden.  I don't know why FLAG_NOWIZARDCELL doesn't prevent
  6930.   this from happening.  Sleep spells are wasted this way too. Leaving for SAI.
  6931.   SAI: Well I looked at the code for this and I can't see anything wrong
  6932.   with it. But I think I have seen this happen as well. I'll investigate.
  6933.   SAI: Found and nailed the bug. NOW FIXED. Details appear later.
  6934.  
  6935.  
  6936. HandeIDCMP changes:
  6937. * I took out that ActivateWindow() call because it was annoying me by
  6938.   transfering my input to chaos when I am in the middle of using another
  6939.   program, such as web browsing or CED etc.
  6940. * Added an ActivateWindow() call to activate the main window whenever
  6941.   you click in the Hires window.
  6942. END HandleIDCMP changes
  6943.  
  6944. * FLAW: Dark Wood, Speed and Slow spell descriptions do not show how many
  6945.   attempts of each you get. FIXED.
  6946.  
  6947. * ADDED: DO_THIS to JC.h and JCformat.c.  Its just like DO_FOREVER.  For
  6948.   some reason every time I see DO_FOREVER my brain expects the whole loop to
  6949.   execute forever even though there could be an exit condition in the
  6950.   LOOP_WHILE or LOOP_UNTIL.  So I just made a DO_THIS.
  6951.  
  6952. * All spells which start with the letters "a"-"g" have been upgraded to JC.
  6953.  
  6954. * BUG: The "Destroy Wall" spell destroys walls but does not reveal what the
  6955.   wall was covering.  If the wall was covering a scroll or artifact or corpse
  6956.   or etc. then it is destroyed.  FIXED by changing
  6957.   InsertCreature(cell,NOTHING,NOTHING) into RestoreCell(cell)
  6958.   I can't think of any time that we should be inserting a NOTHING into a
  6959.   cell.  If we want to get rid of an object then we must use RestoreCell(cell)
  6960.   so that any covered objects are revealed.  If we want to insert a creature
  6961.   then we should just InsertCreature(cell,CreatureID,Player)
  6962.  
  6963.   If you really want to wipe out an entire cell then just call:
  6964. void ClearCell(int cell)
  6965. FUNCTION
  6966.   ObtainSemaphore (&BoardLock); 
  6967.   ClearVisible(cell);
  6968.   ClearUnder(cell);
  6969.   ReDrawCell(cell);
  6970.   ReleaseSemaphore(&BoardLock);
  6971. END_FUNCTION
  6972.  
  6973. * BUGS: Boil, Quench and Still all have the same bug as Destroy Wall.
  6974.   ALL NOW FIXED.
  6975.  
  6976. * ALL occurrences of InsertCreature(cell,NOTHING,NOTHING) removed from
  6977.   every where!  Most were replaced with
  6978.   ClearUnder(cell), ClearVisible(cell), RedrawCell(cell)
  6979.   Now I went back and replaced those code sequences with ClearCell(cell)
  6980.  
  6981. * FLAW: RestoreCell(cell) does not call RedrawCell(cell) like other core
  6982.   routines do.  Since RestoreCell will often change what needs to be drawn
  6983.   there I made it do it automatically. FIXED.
  6984.  
  6985. * BUG: I played a game with 99 hidden scrolls and 99 hidden artifacts and 2
  6986.   wizards and the the initial "Repulsion" messed up the color pallette of the
  6987.   game.  There was a place where the code did a return without reloading
  6988.   the original colour pallette. FIXED.
  6989.  
  6990. * BUG: Animate destroys any item which is under the item being morphed.
  6991.   Corpses, artifacts, scrolls, etc are being destroyed this way.  FIXED.
  6992.  
  6993. * BUGS: Alter Reality, MassMorph and Mutate have the same bug as Animate.
  6994.   ALL FIXED NOW.
  6995.  
  6996. * Nuke destroys the entire cell and I left it that way.
  6997.  
  6998. * CHECKED over every occurrence of InsertCreature in every spell file and
  6999.   everything looks good.
  7000.  
  7001. Question for SAI: I was working on IntelligentMagicWoodCasting and I just
  7002. always assumed that if a wizard was warped off the board then GetWizardCell(p)
  7003. would return -1.  But that is not the case.  GetWizardCell() has no special
  7004. code to handle warped wizards.  Is GetWizardCell going to tell me the
  7005. last position of the wizard when he was on the board?  ??
  7006. Should any of this be changed?
  7007. SAI: This indeed sounds bad. NOW ALLEGEDLY FIXED
  7008.  
  7009. * NEW stuff to be used with my upcoming IntelligentMagicWoodCast(CasterCell)
  7010. * NEW functions sqDistanceFromNearestTeamWizard (CasterCell,cell) and
  7011.                 sqDistanceFromNearestEnemyWizard(CasterCell,cell) which
  7012.   return the sqDistance from cell to the nearest (team/enemy) wizard.
  7013.   Team info is extracted from CasterCell.  CasterCell is only used to
  7014.   determine which team is being dealt with.
  7015. * NEW predicates: isTree, IsTree and isIDTree.
  7016.  
  7017. *** Playtesting ***
  7018. Playtested 1 game, here is what I found.  I controlled 1 wizard against
  7019. 7 enemy wizards.  Nobody was in an alliance. No scrolls, no artifacts.
  7020. 99 spells. 0 turns. Texas Trash'em. 4 generators.  
  7021.  
  7022. * BUG: I was player 2.  Player 8 killed player 3 and somehow all the foes
  7023.   vanquished from the player 3 wizard got put onto my wizard. NOW FIXED
  7024.   (see far below)
  7025.  
  7026. * BUG: Player 6 just killed my orc with his wizard but it put the orc on
  7027.   _my_ wizard's Foes Vanquished.  NOW FIXED (see far below)
  7028.  
  7029. * BUG: uhmmm every wizard that I can see has the exact same Foes Vanquished
  7030.   list. NOW FIXED (see far below)
  7031.  
  7032. I Won the game in 22 turns (This is not a bug :)
  7033.  
  7034. * BUG: After winning it showed the score window and the window title sort of
  7035.   says "Player scores for turn 22" but the first 4 bytes of "Player" are all
  7036.   messed up. Ok, this is happening anytime I click in the HiResWindow.  I
  7037.   don't know why the title gets trashed, it might be a symptom of a serious
  7038.   problem but I have simply worked around it by changing the Wait().
  7039.   Technically the bug is still there, you just don't notice it so much
  7040.   since the window immediately gets closed and reopened.
  7041.  
  7042. started a new game identical to the last one:
  7043. * BUG: Wizards 2,3,4 say "Foes Vanquished 0" on their info screen.
  7044.   Wizards 1,5,6,7,8 have a big blank spot instead. NOW FIXED (see far below)
  7045.  
  7046. Ok, now I completely quit the game, then did "run chaos" from shell.
  7047. Now all the wizards say "Foes Vanquished 0" like they are supposed to.
  7048. *** END Playtesting ***
  7049.  
  7050. * Fixed Eye for an Eye, Torment, Nuke, Free, Alter Reality spell descriptions.
  7051.  
  7052. * CHANGED:
  7053.   isWizard      to isExposedWizard
  7054.   IsWizard      to IsExposedWizard
  7055.   FLAG_NOWIZARD to FLAG_NOEXPOSEDWIZARD
  7056.   to make the code more understandable.
  7057.  
  7058. * Scroll Delay now defaults to 0.
  7059.  
  7060. ** Playtest game **
  7061.  
  7062. * BUG: My ally cast Magic Shield on my Basalt Golem yet its Magic Resistance is
  7063.   still 0.  This happened after most of the other wizards had been killed
  7064.   off. ??? I just cast Magic Shield on myself on turn 1 of a new game and it
  7065.   had no effect! The recovery code was messed up.  NOW FIXED.
  7066.  
  7067. * BUG: Brain Boost doesn't work either!  The recovery code was messed up.
  7068.   NOW FIXED.
  7069.  
  7070. * BUG: an organge jelly just grew over my Nightmare (my nightmare is not
  7071.   being ridden) and the orange jelly just pirated his Foes Vanquished.  The
  7072.   entire list of Foes Vanquished for the Nightmare is now on the Orange
  7073.   Jelly.  NOW FIXED. see below.
  7074.  
  7075. * BUG: I uncovered the nightmare and it has no Foes Vanquished.  It doesn't
  7076.   even say "Foes Vanquished 0".  Its all one big blank spot. NOW FIXED.
  7077.   see below.
  7078.  
  7079. * REWROTE: the whole foes vanquished handling so that a creature can be
  7080.   covered then uncovered and still retain his foes vanquished
  7081.   list without it being displayed on the growth in the meantime.
  7082.   The new way seems more logical to me and it allowed the Killed() function
  7083.   to be much shorter and simpler.  Now the van_count and FoesVanquished and
  7084.   oldvan_count and oldFoesVanquished are all built right into the cell
  7085.   structure.  And the Wizard structure now has van_count and FoesVanquished
  7086.   array also.  NOW FIXED.
  7087.  
  7088. * I intentionally fixed the above two bugs and 1 part of the reason I
  7089.   rewrote the foes vanquished handling was because I was hoping that in the
  7090.   process of doing so all the other foes vanquished bugs would mysteriously
  7091.   disappear.  Well, guess what?  That is exactly what happened.  All the
  7092.   other foes vanquished bugs just mysteriously disappeared.  ALL FIXED NOW.
  7093.  
  7094. * Modified io.c to properly load and save the information.  This means the
  7095.   gamesave format has changed.
  7096.  
  7097. By turn 23 it was down to just me and 1 allied computer wizard.
  7098.  
  7099. * BUG: _Any_ time _any_ wizard kills _anything_, the kill shows up on ALL
  7100.   wizard's "Foes Vanquished".  NOW FIXED. see above.
  7101.  
  7102. BUG: at some point the audio started sounding strange.. blah blah blah.
  7103. I quit the game normally.  Later on I recompiled and when it was supposed
  7104. to say "compilation complete" the whole computer crashed and reset (no guru)
  7105. and the hard drive nearly got trashed.  It is "validating" now (has been
  7106. for several minutes).  No actual data was lost due to the fact I'm using a
  7107. real computer and not a pentium.  Be on the lookout for some sort of audio
  7108. device using/opening/closing bug.  I think maybe an audio channel doesn't
  7109. get closed sometimes. See below.
  7110.  
  7111. * BUG: When computer wizard 1 is on the top of the screen and he is trying to
  7112.   mount his steed yet is engaged, this triggers enforcer hits.  Enforcer
  7113.   hits do a DisplayBeep() which is what messes up the sound I think.  I
  7114.   know that enforcer hits make the sound effects sound funny.  I think this
  7115.   is because it changes the setting of the audio filter.
  7116.   (Enforcer Hits problem was in EngageChoice)  NOW FIXED!
  7117.  
  7118. * STUPID: A computer wizard cast demonic touch on a sleeping dragon (which
  7119.   was the only enemy creature that he could cast it on). FIXED.
  7120.  
  7121. * STUPID: Actually, after looking at the code I could see that ANY spell
  7122.   might potentially be cast on sleeping creatures.  I changed it so that
  7123.   casting any spell on a sleeping creature is considered stupid except for
  7124.   Wake. FIXED.
  7125.  
  7126. * BUG: A wizard cast Alter Reality on a pegasus being ridden by another
  7127.   wizard and the spell failed.  I have changed Alter Reality so that it can
  7128.   be cast on creatures which are being ridden by the wizard. I tested this
  7129.   and it really works! FIXED.
  7130.  
  7131. * BUG: Sometimes wizards try to cast Kill on a creature which is being
  7132.   ridden.  The assistance says FLAG_NOEXPOSEDWIZARD yet the spell is
  7133.   programmed to fail if there is a wizard anywhere in the cell.
  7134.   I changed this so that the spell now matches its computer assistance
  7135.   flags.  This means it now succeeds against mounted creatures. FIXED.
  7136.  
  7137. * FLAW: You can't easily tell when a Subversion/Betrayal/Abduction works or
  7138.   not.  It now prints "Spell Succeeds!" at the bottom of the screen
  7139.   when it succeeds. (It already said "Spell fails" when it fails.) NOW FIXED.
  7140.  
  7141. ** END playtest game **
  7142.  
  7143. * REMOVED SoundStat from the CreatureInfo structure for the following
  7144.   reasons.
  7145.   1. It doesn't belong there.  This stat will be set dynamically and will
  7146.      be different on different people's amigas.  It shoudn't even be saved
  7147.      in the savegame file.  It ABSOLUTELY should not be saved in the
  7148.      savegame file.  Well, ok I guess we could save it so long as we
  7149.      regenerate the stat each time we load the game.
  7150.   2. It was a UBYTE which isn't big enough anyway.
  7151.   3. It was stuck in the wrong place for some unknown reason so by
  7152.      eliminating it we actually save 4 bytes instead of only 1. (it was
  7153.      totally messing up the alignment.)
  7154.   4. I am going to implement SoundStat as its own array when I start adding
  7155.      the digital sound effects to the game.
  7156.  
  7157. * INTELLIGENT MAGIC WOOD CASTING implemented: Works great!
  7158.   Wizards now cast Magic Woods close to themselves and their allies while
  7159.   keeping them as far away as possible from their enemies.
  7160.   However any wizard who has " mad", "mad ", "kalsu", "crazy", "krazy" or
  7161.   "insane" in his name will use the random treecasting routine instead.
  7162.   This feature is dedicated to Joseph Dixon who said the old way of
  7163.   casting trees made the game look stupid 8)
  7164.  
  7165. Feb. 22, 1999 Mike the freak tried to start a fight with me.
  7166. Nothing accomplished Feb. 23-24.
  7167.  
  7168. * BUG: Team Scores are wrong when several people are on each team.
  7169.   Team Life is wrong when several people on each team.
  7170.   The score and life of the lowest numbered team is being displayed for
  7171.   their team and their score and life are being displayed for the OTHER
  7172.   team.  NOW FIXED. + the code is a bit more simplified.
  7173.  
  7174. * NEW FUNCTIION: AdjacentEnemies(source,cell) to return the number of
  7175.   enemies of source which are adjacent to cell.  Needed for below:
  7176.  
  7177. * INTELLIGENT DarkWood and ShadowWood Casting Implemented.
  7178.   Basically the computer wizards try to cast these trees adjacent to lots
  7179.   of enemies which are nearby.  A small consideration is given to
  7180.   enemy generators.
  7181.  
  7182. * NEW FUNCTIONS to support IntelligentCreatureCast
  7183.   int isWizardInDangerOfDying(int cell);
  7184.   int TotalCombatOfAllAdjacentEnemies(int source,int cell);
  7185.   int TotalRangedCombatOfAllAdjacentEnemies(int source,int cell);
  7186.   int SmallestAdjacentEnemyLifeToCombatRatio(int source,int cell);
  7187.  
  7188. * AVOIDED passing player numbers as parameters to all new functions.  This
  7189.   is to facilitate the elimination of all old wizards[] references by
  7190.   upgrading to Wizards[] and to help me get rid of all those p+1, p-1
  7191.   constructs.
  7192.  
  7193. * PROBLEM: Every time I am about to win the game I have a bunch of
  7194.   creatures closing in on the last enemy wizard.  It is now a bit harder to
  7195.   kill wizards since they are sometimes surrounded by trees which block
  7196.   many of my possible paths of attack and shooting.  But every time as I am
  7197.   closing in the computer wizard will cast a creature to stop me but he
  7198.   always casts it in the wrong place (like BEHIND him instead of in FRONT of
  7199.   him).  This always makes me feel sorry for the poor stupid computer
  7200.   wizards.  If only he would have cast his dragon IN FRONT of his wizard
  7201.   (between his wizard and my dragon) he could have lived for at least 1 more
  7202.   turn.  The solution is the following:
  7203.  
  7204. * INTELLIGENT CREATURE CASTING Implemented.  Works great.
  7205.  
  7206. * WOW: I just played a test game and here is what happened on turn 1:
  7207.   A computer player intelligently surrounded himself with MagicWoodTrees
  7208.   The excess trees were placed down and to the right which was very smart
  7209.   because nobody was anywhere near the bottom right corner.
  7210.   Then, the next computer player cast a Thundermare.  But instead of
  7211.   casting it next to himself he cast it 3 squares away next to the guy who
  7212.   just cast those magic trees.  The ThunderMare is now adjacent to the enemy
  7213.   wizard and 2 of his Magic Trees!  He's ruthless!  And he did this EVEN
  7214.   though there was another wizard who was closer! (but had no magic trees
  7215.   or other creatures.)
  7216.  
  7217.   Another computer wizard cast a nightmare and instead of casting it
  7218.   randomly he cast it adjacent to an enemy wizard who is now engaged to an
  7219.   undead creature!
  7220.  
  7221.   The above 2 engaged wizards were the first to die, thus proving that the
  7222.   other wizards, did, in fact, cast intelligently.
  7223.  
  7224.   Couple of turns later: Some computer guy just cast a Bolter Wall directly
  7225.   between my wizard and my Eagle!  He completely messed up my whole plan!
  7226.   Instead of just throwing it out on the board he put it where it would
  7227.   cause me a lot of problems.
  7228.  
  7229. * BUG: in new IntelligentCreatureCast: Casting a creature while in someone
  7230.   else's tree makes the creature become the tree owner's instead of the
  7231.   caster's. FIXED.
  7232.  
  7233. * All spells which start with "h"-"p" have been upgraded to JC.
  7234.  
  7235. * PROBLEM: I have killed wizards many times on the first turn with Ball
  7236.   Lightning and many other times during the game also.  In fact, lately
  7237.   I've been winning the game in only 12-18 turns.  So I have now
  7238. * REDUCED Ball Lightning's Life damage from a 10:1 ratio down to 2:1.
  7239.   
  7240.  
  7241. BUG: My wizard with 21 life just cast sanctuary and it only gave him
  7242.   2 recovery!!!  I am unable to duplicate this bug.  Perhaps someone
  7243.   whacked him with a poison dagger when I wasn't looking.  I don't know.
  7244.  
  7245. * BUG: The spellmanager just crashed my computer while processing the
  7246.   spell file for MassMorph.  I mistyped Commment: instead of Comment:
  7247.   FIXED by SAI.
  7248.  
  7249. * All spells which start with "q"-"z" have been upgraded to JC.
  7250.  
  7251. * CHANGED: Abath combat from 4 to 8 since the description says that it
  7252.   has an enlarged horn which can induce severe bruising.
  7253.  
  7254. * BUG: smake newspell does not rebuild pool.ssc.  Thus when I change a
  7255.   spell description and do smake newspell, the new description is included in
  7256.   spells.tex and spells.html but not in the game itself.
  7257.   smake clean smake dev does not rebuild pool.ssc either.  As near as I can
  7258.   tell only smake release rebuilds pool.ssc. Leaving this for SAI.
  7259. SAI: Allegedly fixed this by making smake newspell first delete pool.ssc
  7260.   so that the system will have no option but to remake it.
  7261. SAI: Well that didn't work, so now I deleted pool.txt as well.
  7262. SAI: That didn't work either, ISWYM about this problem. I think the real
  7263. difficult is that Amiga makefiles don't allow two dependencies on the left.
  7264. SAI: Oh, no wonder it isn't working there is nothing in the makefile that
  7265. causes the pool.ssc line to be invoked. Therefore I've added pool.ssc
  7266. to the top line of requirements in makechaos.
  7267. SAI: No that didn't work either. Oh, well I continued fixing this
  7268. below.
  7269. SAI: Gave up on the old makefile and rewrote it.
  7270.  
  7271. *************************************************************
  7272. ***** MAD RAMPAGE to eliminate all wizards[] references *****
  7273. *************************************************************
  7274.  
  7275. * REPLACED all 3 of the remaining wizards[] references with Wizards[] in
  7276.   predicate.c.  Rewrote various FOR NEXT loops to facilitate this.
  7277. * REPLACED both of the remaining wizards[] references with Wizards[] in
  7278.   chaos.c.
  7279. * REPLACED all 5 of the remaining wizards[] references with Wizards[] in
  7280.   bonus.c. Rewrote ChooseGUISpell() to require a REAL player number instead
  7281.   of a fake one.
  7282. * REPLACED all of the remaining wizards[] references with Wizards[] in
  7283.   spell.c.
  7284. * REPLACED all 10 of the remaining wizards[] references with Wizards[] in
  7285.   cast.c  Rewrote DoComputerCast() and PlasmaBeamHandler to require a REAL
  7286.   player number.
  7287.  
  7288. After doing all the above I played some test games and found that I had
  7289. accidentally created 2 bugs.  These were easily fixed but it shows that
  7290. extreme caution is warranted.
  7291.  
  7292. * All wizards[] references have now been successfully eliminated from
  7293.   everywhere except the spell files.
  7294.  
  7295. Create a new variable "Player" for Cast, CastFree and CastMagic.
  7296. This variable will replace "player" and "p" slowly but surely.
  7297.  
  7298. player and p are the old fake player numbers.
  7299. Player is the REAL player number.
  7300.  
  7301. So it is simply a matter of replacing all wizards[p] or wizards[player]
  7302. with Wizards[Player]
  7303.  
  7304. Eventually "player" and "p" will be obsoleted and removed.
  7305.  
  7306. Any function calls of the form Function(player) will be replaced with
  7307. Function(Player-1).  Eventually all functions will be rewritten to use REAL
  7308. player numbers so that the -1 can be removed.
  7309.  
  7310. Any function calls of the form Function(player+1) will be replaced with
  7311. Function(Player)
  7312.  
  7313. Replace wizards[player].xyz with wizardsp->xyz (which = Wizards[Player])
  7314.  
  7315. Before attempting this, the main filesize of a smake release is 358544
  7316.  
  7317. * All old wizards[] references have been REMOVED from ALL Spell files!
  7318.   YAY!!
  7319.  
  7320. * REWROTE: Drainer(), WakeUp(), HandleJoker(), ScoreAdd(),GetWizardCell(),
  7321.   CastFreeSpell(), CastMagicSpell(), Multiplicity(), 
  7322.   to use REAL player numbers instead of fake ones.
  7323.   This allowed me to eliminate ZILLIONS of "Player-1" style references.
  7324.  
  7325. * Removed "player","p" and "i" from cast.c functions.
  7326.  
  7327. * REWROTE the FOR-NEXT loops so that the "currentPlayer" global variable is
  7328.   now the REAL player number instead of the realnumber-1.
  7329.  
  7330. * REWROTE InformationPanel(), InformationPanel1(), SayName(), AddSpell(),
  7331.   AddGUISpell(), GetSpells(), WhatSpell(), QuerySpell(), SetSpell(),
  7332.   ComputerSpellDiscard(), IntelligentComputerSpellSelect(), 
  7333.   to use REAL player numbers instead of fake ones.
  7334.  
  7335. * ALL the functions in cast.c, predicate.c, predicate.h, info.c, chaos.c,
  7336.   spell.c which take a player parameter now take a REAL player parameter.
  7337.   ALL the functions in move.c and cmove.c already took REAL player numbers.
  7338.  
  7339. * Several functions in spell.c which take a real player number parameter
  7340.   still use fake player numbers internally to index into various arrays.
  7341.   I'll fix that later.
  7342.  
  7343. * Main filesize of smake release is now 357308.  Only saved 1236 bytes.
  7344.  
  7345. **************************************************************
  7346. ***** END MAD RAMPAGE ****************************************
  7347. **************************************************************
  7348.  
  7349. * STUPID: A computer wizard cast reincarnate on his ally's Bolter Wall
  7350.   which already had Reincarnate cast on it. FIXED.
  7351.  
  7352. * STUPID: A computer wizard cast Horror on a creature which already had
  7353.   Horror. FIXED.
  7354.  
  7355. * POSSIBLE BUG: A computer wizard just cast "Free" on a manticore that was
  7356.   being ridden by another wizard. The Manticore is now an independent and is
  7357.   still being ridden.
  7358.   SAI: Yep, this is a bug, the spell file need to check for this.
  7359.   SAI: NOW FIXED.
  7360.  
  7361. * BUG: Click on an eyeball.  Now try to attack an undead creature by
  7362.   accident.  Now it says you are engaged even though there are NO creatures
  7363.   next to you.  You can't move or do anything but cancel your movement.
  7364.   This was found when I tried to attack a Wizard that had Liched himself.
  7365.   Leaving this for SAI. FIXED by SAI. Details appear later.
  7366.  
  7367. ************************************************************************
  7368. *******  An Enforcer Hit Bug Related to a Vanished Computer Wizard *****
  7369. ************************************************************************
  7370.  
  7371. BUG: I vanished an enemy wizard and then at some point thereafter (perhaps
  7372. in the movement phase) numerous enforcer hits occurred.  Unfortunately I
  7373. forgot to run the game under CPR so I don't know what caused this exactly.
  7374.  
  7375. I saved the game at this point.
  7376.  
  7377. BUG: the thinking phase of the vanished wizard triggered more enforcer
  7378. hits.
  7379.  
  7380. I played the game for several more turns until I won.
  7381.  
  7382. Now I quit the game and did a run cpr chaos
  7383.  
  7384. oh great, when I try to load the saved game it doesn't work! 8(
  7385.  
  7386. I'm figuring that this is all related to bogus returns by GetWizardCell
  7387. when a wizard has been vanished.
  7388.  
  7389. Ok, I just spent half an hour looking around at files, trying to decide
  7390. what I'm going to do tomorrow.  I'm tired now.  I'm going to bed.
  7391.  
  7392. STRANGE: I woke up the next morning and whaddaya know?  The game from last
  7393. night is sitting there in cpr with a BUS/ENFORCER HIT in IsExposedWizard.
  7394. (I leave my amiga on almost all the time.)
  7395.  
  7396. So the game loaded correctly after all!  YAY!  I have no idea what caused
  7397. the huge delay.
  7398.  
  7399. This is all caused by the first few lines of IntelligentComputerSpellSelect
  7400. which derives the cell of the wizard, which for a Vanished wizard is all
  7401. completely bogus.  Leaving this for SAI.
  7402.  
  7403. SAI: I will attempt to replicate this problem if I have time. Problems like
  7404. this used to occur when warped wizards mistakenly tried to cast spells.
  7405. The only likely reason is that something has corrupted the warped bit of
  7406. the corresponding wizard entry.
  7407.  
  7408. SAI: Vanished objects should never try to select a spell in the first place.
  7409. However, the code in IntelligentComputerSpellSelect will indeed fail if it
  7410. is called erroneously like this, because their will be a dereference of the
  7411. type board[-1].
  7412.  
  7413. JC: Ok I fully understand this problem now.  Vanished wizards should never
  7414. be thinking about casting a spell because their .Warped bit will be set.
  7415. So if I ever encounter this bug again I'll know what to look for and can
  7416. hopefully fix it.  
  7417.  
  7418. ***************************************************************************
  7419. ***** End of An Enforcer Hit Bug Related to a Vanished Computer Wizard ****
  7420. ***************************************************************************
  7421.  
  7422. * IMPROVED the speech of "Player One", "Player Two" etc.
  7423.  
  7424. * STUPID: A wizard just cast combat on himself and on the next turn he cast
  7425.   Poison Dagger on himself, thus wasting his combat spell!  FIXED by raising
  7426.   the ranking of Poison Dagger by 4 points to be 1 point higher than Combat +
  7427.   modified IsStupidCast().
  7428.  
  7429. HYBSIL says it fires poisoned arrows.  So we should either:
  7430. A) Make its Ranged Combat attack recovery or
  7431. B) Change the description to say "more powerful arrows" or "deadlier
  7432.    arrows" or "stronger arrows" or something of that nature.
  7433. Which do you want to do?
  7434. SAI: Implemented option A. NOW FIXED.
  7435.  
  7436. * CHANGED: WoodElf only needs 4 kills to be promoted to a DreadElf.
  7437.  
  7438. ReleaseSemaphore(&SourceCode); by JC on March 10th, 1999.
  7439. ObtainSemaphore(&SourceCode); by SAI on 990312
  7440.  
  7441. * Siphoned off 1998 readme stuff into a separate file: readme.1998.
  7442.  
  7443. * Expanded the list of names available at the start of the game. See the
  7444.   file namer.c for details. Basically names at the start of the game
  7445.   are randomly assigned from a possible list. It would be easy to make
  7446.   this a configuration file like "TalkLines" but I have refrained from
  7447.   doing so because I don't want a massive proliferation of such files.
  7448.   Players can of course still edit the names at run time.
  7449. JC: Hmmmm... I hadn't ever really thought of the TalkLists file as a
  7450. "configuration file" that end users would manipulate.  I just made it the
  7451. way it is to be easy for me to update it.  But now that you have mentioned
  7452. it -- it really is a user configurable file like spell.prb
  7453.  
  7454.  
  7455. QUESTION: Should players be able to edit names?
  7456. JC: YES!  Absolutely.  When I play games against other humans we _always_
  7457.     edit our names.  We even edit the names of the computer wizards to have
  7458.     their player number after their name.
  7459.  
  7460. We could save memory
  7461. (by dropping all the gadgets associated with such editing) but
  7462. disallowing it. In general I am keen on options like that, but if
  7463. very few people use it perhaps it is not worth it. I for one hardly
  7464. ever alter my name. ??
  7465.  
  7466. PROPOSAL: Amalgamate various configuration files into a single file
  7467.     TalkLines
  7468.     chaos.prb
  7469.     classic.prb
  7470.     WizardNames  (not yet existing)
  7471.     Default preferences (not yet existing)
  7472. I suspect it would take about 2K to implement a full parser for such
  7473. a file. (However, these files all have separate parsing at the moment
  7474. anyway--so perhaps it would reduce memory usage--it would also
  7475. certainly improve startup speed).
  7476.  
  7477. JC: I like having seperate files for seperate things.  Its nice and logical
  7478.     that way.
  7479. JC POSSIBLE COUNTER PROPOSAL: Simply put all user-configurable files in their
  7480.    own directory. Config/   Then if a user wants to configure something there
  7481.    will be some files there each clearly named as to its purpose.
  7482.    Of course it is entirely possible to play the game for years and never
  7483.    need or want to edit the probability files.  I've only done it once
  7484.    myself.  My real life friends who play the game have _never_ edited the
  7485.    probability files.
  7486.  
  7487.    The problem with this idea is that a config directory is more noticeable
  7488.    and people will be more likely to go in and change things around.
  7489.    Whereas now, most people don't even think about it and they leave
  7490.    everything the way it is.
  7491.  
  7492. JC: Bottom Line: I'm perfectly happy with things the way they are.  People
  7493.    don't really need to know that TalkLists.txt is editable by them.  If
  7494.    they figure out they can add their own stuff in then let them.  It'll be
  7495.    there for the power users.
  7496.  
  7497.  
  7498. PROPOSAL: Drop the menu section of creatures from the editor (the
  7499. pull down menus that is, not the graphical method!) This menu
  7500. system is really rather redundant given the graphical method and
  7501. is harder to maintain automatically when new spells are added.
  7502. Finally it has no support at all for non creature spells.
  7503. JC: I concur 100%
  7504.  
  7505.  
  7506. PROPOSAL: Given that we are tentatively going outside the std A500,
  7507. I recommend using #ifdef BIG to surround code to appear only in the 
  7508. advanced version. This would be preferrable to having to maintain the
  7509. old version separately. I can see there are still a few potential
  7510. problems, in particular with dealing with the spell files via
  7511. Spell Manager etc. I will have to add a new tag similar to Classic
  7512. indicating whether a given spell should only be present in the BIG
  7513. version of the game.
  7514. JC: If you want to try this you can, but it will be entirely your
  7515.     responsibility 8).   Once I finish the 1 meg version I intend to never
  7516.     look back.  All the current gaming consoles like PlayStation have at
  7517.     least 2 megs of ram.  The newest game console, the Sega Dreamcast has
  7518.     26 MEGS of ram!  Most of the people I know who still use A500s have at
  7519.     least 5 megs of ram on their system.  But the real kicker is that once
  7520.     I implement the graphics upgrade I don't think you can possibly do any
  7521.     #ifdefs to make it run.  The graphics are simply going to take more
  7522.     than 1 meg, in fact they will quickly be approaching the 2 meg limit.
  7523.     HINT TO ALL 1 MEG AMIGA OWNERS: For god's sake, buy some more memory!
  7524.  
  7525. * Removed traces of TeX from defines.h
  7526.  
  7527. * Completely went through spell.c making modifications to
  7528.     A: Eliminate spell selection gadgets.
  7529.     B: Make it so we use standard player numbers.
  7530.     C: Remove TeX/fix comments
  7531.     D: To do a general audit on the code.
  7532.  
  7533. * Okay I finished all the changes for Phase 1 of the spell selection
  7534.   upgrade and went to move them to my Amiga via a PC disk. Immediately
  7535.   I had a problem. DOS as usual truncated my Linux/AmigaDOS files names
  7536.   to 8 letters so that MakeDemoOfChaos became MakeDe~1. Now I knew this
  7537.   would happen and my Amiga had no problem copying them off the PC disk
  7538.   onto my harddrive. But then the problems began. The brain dead AmigaDOS
  7539.   rename command just would not rename the files to something sensible.
  7540.   I tried all sorts of ways of doing it. Copy didn't work either, it
  7541.   just insisted on making a new directory every time. In the end I had
  7542.   to delete them (at least it let me do that) and copy them again from
  7543.   Linux with shorter names. Another 10 minutes wasted. OK, DOS is real
  7544.   lame for having such a stupid filename limitation, but AmigaDOS is
  7545.   just as daft for letting you create files that you can't rename or
  7546.   copy! I never have these problems with Linux. Well if my Amiga wasn't
  7547.   so old and slow then I suppose I would be more keen to use it.
  7548.   JC: the ~ symbol is used by AmigaDOS to mean "not" in pattern matching.
  7549.       so that you can things like:
  7550.   LIST ~(#?.txt) to list all files that do not end in .txt.
  7551.   | is used to mean "or" btw.  Anyway, I guess this causes a bug in the
  7552.   copy and rename commands when dealing with files with ~ in them. 8(
  7553.   
  7554.   Hint to SAI: Buy a faster Amiga! 8)  I have a lot of Amiga friends on the
  7555.   net with 50 Mhz 060s.  That's about 10x faster than our 25Mhz 030s.
  7556.   And I haven't even mentioned the ones with 200Mhz PPC Amigas.
  7557.  
  7558.  
  7559. * Anyway back to the important stuff. The SpellTable now works with
  7560.   real player numbers. There are new functions in spell.c to deal with
  7561.   displaying spells for selection using simple mouse events rather than
  7562.   gadgets. HandleIDCMP in chaos.c has been modified accordingly.
  7563.  
  7564. POTENTIAL BUG: Looking at HandleIDCMP I don't see what is stopping the
  7565.   program from doing an InformationPanel request on invalid information
  7566.   when the player clicks outside of the normal board. I will test this
  7567.   as soon as I can get the game to compile again. NO, I JUST OVERLOOKED
  7568.   ONE IF STATEMENT. The call is safe. NOT A BUG. IGNORE THIS PARAGRAPH
  7569.  
  7570. * As a result of my changes the file "gadget.c" is now obsolete and
  7571.   has been deleted.
  7572.  
  7573. * Well it seems some of my changes don't want to compile. So I think it
  7574.   is time I go to bed and sort out the problem when I am fresh in the
  7575.   morning. In particular my clever &HST[-1] assignment failed because
  7576.   it can be done at compile time, although I don't understand why
  7577.   given that both objects are static. Anyway I'm sure I will be able
  7578.   to fix that in the morning.
  7579.  
  7580. SATURDAY 990313
  7581.  
  7582. * I got my changes to compile now. My new names didn't work at all, the wizards
  7583.   just showed up without names. The spells were not quite drawn at the
  7584.   correct position and worse the same spell was repeated for the entire
  7585.   screen. Finally the spell selection didn't work at all.
  7586.  
  7587.   Okay it is now displaying the spells okay but the selection is not working.
  7588.   Damn, I've just been called into work when I thought I would have the whole
  7589.   day for Chaos. At least I managed to put them off until the afternoon. I
  7590.   should have used my modem so they couldn't call me! Now my Amiga appears to
  7591.   have locked up during compilation (I'm writing this on my Linux box). I'll
  7592.   give it a couple more minutes. REBOOT. Okay compilation successful again.
  7593.  
  7594. * Phase 1 of the spell selection upgrade is now completed. The spell gadgets
  7595.   are gone.
  7596.  
  7597. * I've run into trouble trying to manipulate the HST[][MAX_SPELLS] structure.
  7598.   I can't get the compiler to give me a pointer one entry logically earlier
  7599.   than memory than the first. I want HST[-1]. Normally this sort of thing
  7600.   works exactly as you would expect, but in this case the compiler just gives
  7601.   modifiable lvalue complaints, but I don't know how else to declare the
  7602.   pointer I wish to assign to. The weird thing is that when I use #define
  7603.   (&HST[-1]) for the same purpose it works without problems. I'm sure that
  7604.   short *SpellTable[MAX_SPELLS] ought to give me a 4-byte quantity which is a
  7605.   pointer to a array of MAX_SPELLS short, and maybe it is but the compiler then
  7606.   will not let me do SpellTable = HST[-1].
  7607.  
  7608.   Finally got it sussed the relevant line is (from spell.c):
  7609.     static short (*SpellTable)[MAX_SPELLS] = &HST[-1];
  7610.   getting the parentheses in there was the key.
  7611.  
  7612. * Moved the Dismount gadget up next the query gadget.
  7613.  
  7614. * Implemented Phase II of the spell selection upgrade. The spell the mouse is
  7615.   over is now reported at the bottom of screen. The works harmoniously with
  7616.   normal cell reporting. The relevant changes are in HandleMOUSEMOVE.
  7617.  
  7618. * I decreased the delay for messages to stay on the screen during computer
  7619.   spell selection. It still seems too long so I will shorten it more yet.
  7620.   I think it adds to the atmosphere if you have to read quickly, helps
  7621.   gives the impression of action.
  7622.  
  7623. * I've just noticed that computer players no longer use their spells up
  7624.   (i.e. they are just getting the same spell over and over again). However,
  7625.   I know why this is happening and it will be easy to fix. NOW FIXED
  7626.  
  7627. * Blanked the bottom area of the screen after spell selection.
  7628.  
  7629. * Fixed a problem with discarding. Now marks a spell used when it is first
  7630.   selected so that the player canNOT discard the same spell (this was done
  7631.   in a completely different way under the gadget scheme).
  7632.  
  7633. * Changed printing routines in text.c to const char* to better reflect
  7634.   their true nature and suppress some compiler warnings (i.e. compiler
  7635.   will silently promote char * -> const char *, but complain bitterly
  7636.   going the other way). Didn't do this to WriteNearBottom since it
  7637.   does not treat its argument as constant.
  7638.  
  7639. * Eliminated all warnings in the compilation of chaos.c
  7640.  
  7641. * Discovered that it was still printing the last spell list lines at the
  7642.   bottom of the screen even when they weren't actually displayed on the
  7643.   right of screen. Modified HandleIDCMP so it no longer does this.
  7644.  
  7645. * Modified GetSpellSelection to blank the lower lines after each player
  7646.   has selected a spell.
  7647.  
  7648. * Reduced the delay on the text messages even further. There is now a
  7649.   constant BASE_DELAY in defines.h which controls this.
  7650.  
  7651. * When spell selection occurs now a blank square is drawn over the
  7652.   selected spell. This helps make things clearer especially when using
  7653.   the Texas mode.
  7654.   JC: Cool. Good idea.
  7655.  
  7656. * I just discovered that the MagicCastle spell is functioning as a non
  7657.   spell. Clicking on it is just ignored, it doesn't get used, and you
  7658.   don't get a chance to use it. This was because MagicCastleID must be
  7659.   the same as the gadget code for EndID. I modified the way HandleIDCMP
  7660.   returns the EndID in the case of a spell return to fix the problem. I
  7661.   was lucky this happened on such a common spell or this problem might
  7662.   have gone unnoticed for some time. NOW FIXED
  7663.  
  7664. * Removed all the no longer necessary references to spellGadgets.
  7665.   This ends the spell selection upgrade.
  7666.  
  7667. WARPING PROBLEMS:
  7668.  
  7669. * Hmm. GetWizardCell did seem to have some shortcomings. It now checks
  7670.   if a wizard is alive and not warped before trying to calculate a cell.
  7671.   In the case of a dead or warped wizard it returns -1. This will of
  7672.   course never match a real cell on the board. Previously, a dead wizard
  7673.   would have been reported at is position of death(?) and a warped wizard
  7674.   would have returned -(GAMECOL + 1). But this was then cast to an UWORD
  7675.   so it would have been some big positive number. I'm not sure why this
  7676.   should have caused problems tho'.
  7677.  
  7678. * The three ways things can get warped out are Hide, Vanish, and via a
  7679.   vortex. All three of these use the WarpOut function and so there should
  7680.   not be any problem there.
  7681.  
  7682. * NEW POWERUP: An orc, goblin, or troll killing an elf, will now pick up the
  7683.   bow previously used by the elf.
  7684.  
  7685. * I just saw the problem where a computer wizard cast sleep on a mounted
  7686.   creature. There were no other suitable targets nearby, but it still
  7687.   doesn't explain why that spell was selected in the first place.
  7688.   NOW FIXED
  7689.  
  7690. * Improved the editor so that cutting and pasting a wizard, will cause the
  7691.   game to correctly register the wizard's position. It will also make the
  7692.   wizard alive and not warped. I haven't tested this very well yet, put
  7693.   multiple copies of a wizard at your own risk.
  7694.   JC: ah... yes I see what you mean.  Maybe we should have a different
  7695.       method for positioning wizards?  We just need some way to control the
  7696.       starting positions of wizards for certain predefined levels.
  7697.  
  7698. * I also noted the Docs contain nothing about how to use the editor.
  7699.  
  7700. MAKEFILE PROBLEMS: I've been trying to correct the pool.ssc problem for the
  7701. last hour now.
  7702.  
  7703. * While trying to fix the problem re makefile/pool.ssc, I added a new
  7704.   creature "Ogre Warrior" to test it.
  7705.  
  7706.   I've tried several times. I finally got it to automatically recreate
  7707.   pool.ssc, but it was still incorrect because it did not include the
  7708.   description for the new spell, thus if threw most of the other spells
  7709.   off by one position.
  7710.  
  7711.   This arose because info.c was recompiled before the new index.h file
  7712.   (dependent on pool.txt) was generated. I've now changed things around
  7713.   so that "smake newspell" deletes info.o and info.o depends on pool.ssc
  7714.   which in turn depends on pool.txt. I think this should be sufficient.
  7715.  
  7716. * Fixed a bug in image.c that was placing extra carriage returns in output.
  7717.  
  7718. * Fixed the editor so that the spell list is redisplayed when the editor
  7719.   exits.
  7720.  
  7721. * Attempted to fix the problem where the bonus spell selection panel is
  7722.   sometimes made bigger than it should be.
  7723.  
  7724. * Fixed a bug pertaining to computer wizard spell selection that was
  7725.   resulting from my earlier changes to spell selection.
  7726.  
  7727. * Discovered that I still haven't succeeding in fixing the make newspell
  7728.   problem. Now it is not rebuilding chaos.dat correctly!
  7729.  
  7730. * Decided that the current system of a lmkfile and makechaos really
  7731.   sucks, so I rewrote the makefile and it is now just called "Makefile".
  7732.   (I renamed lmkfile to stinkfile). The new file seems to work much better
  7733.   but obviously I need to test it a fair bit more yet.
  7734.  
  7735. ELIMINATION OF MOUNTED BIT
  7736.  
  7737. * Eliminated all occurrences of the MOUNTED bit from the code. Unfortuantely,
  7738.   I haven't changed all the documentation to reflect this change. Anyway from
  7739.   now on all testing for wizards should be done with GetWizardCode(cell).
  7740.  
  7741. PROMOTIONS UPGRADE
  7742.  
  7743. * I added a routine to do sensible promotions on a cell. Several stats now
  7744.   take the max of the original and the new creature. Not all of them, so there
  7745.   is still some additional challenges for those deliberately going for power
  7746.   ups.
  7747.  
  7748. * Then I decided that the code in "move.c" for actually testing for powerups
  7749.   was rather silly, so I rewrote it to use a table rather than a whole pile
  7750.   of IF statements.
  7751.  
  7752. * Then I realized that the table should be generated from the spell files
  7753.   rather than maintained separately. Therefore, I added tag recognition
  7754.   for "Promotion" and "ProCount" to the Spell Manager. So now when you want
  7755.   a creature to get promoted you need only put entries in the corresponding
  7756.   spell file (see woodelf.spl and ogre.spl for examples). At present the
  7757.   such powerups can only be specified if they occur once a certain number
  7758.   of kills have been achieved.
  7759.  
  7760. * None of this change does not affects Horse->Thundermare->Iridium or
  7761.   other powerups that don't just involve bonuses for multiple kills.
  7762.  
  7763. * At present the power ups using the new system are:
  7764.     WoodElf -> DreadElf (4 kills)
  7765.     Ogre -> Ogre Warrior (5 kills)
  7766.     Ogre Mage -> Ogre Assassin (7 kills)
  7767.     Green Dragon -> Emerald Dragon (7 kills)
  7768.  
  7769. * Eliminated a warning in the compilation of move.c
  7770.  
  7771. SLEEPING/SUBVERSION on WIZARD BUG SOLVED
  7772.  
  7773. * I finally tracked down the problem whereby computer wizards having been
  7774.   casting sleep etc. on mounted wizards when the code looks like it
  7775.   explicitly rules it out. The problem was that "flags" was declared as a
  7776.   UBYTE in isStupidCast and DoComputerCast when in should have been
  7777.   USHORT. I wish the type checking on the compiler was a little more
  7778.   stringent sometimes. Anyway I believe this change has erradicated the
  7779.   observed bugs.
  7780.  
  7781. * Made the fade twice as fast in Disection spell.
  7782.  
  7783. * Changed that Magic Shield spell, so that casting a shield on a creature
  7784.   with maximum MR causes its MR_Recover rate to increase by one. Hence
  7785.   by casting lots of shields you can make something *very* magic resistant.
  7786.   Changed Protection to work the same way.
  7787.  
  7788. * Eliminated a warning in the compilation of cast.c
  7789. * Fixed the bug in the Free spell.
  7790.  
  7791. * CHANGED BoardEffect so that when the effect is for the entire screen
  7792.   no sound is produced (I found things like "cure" were getting real
  7793.   annoying because they take several seconds to complete). [Note I am
  7794.   talking here about the GREENCIRCLEEX effect in cell.c]
  7795.  
  7796. META-COMMENT: I've been quite pleased with how much progress I've made in
  7797. the little time I've had to work on things. It has been really helpful
  7798. having JC's list of bugs with clear things requiring my attention. I note
  7799. there are still a fair few bugs on the list to go, so I best get on with it!
  7800.  
  7801. * FIXED the bug that was preventing movement after accidently making an
  7802.   invalid attack. I'm sure this bug must have been introduced as the 
  7803.   result of one of our rationalizations. Anyway it is all fixed now.
  7804.  
  7805. * CHANGED: Hybsil when shooting now affect Man and Recover stats making it
  7806.   more consistent with poison as the description says.
  7807.  
  7808. * Made move.c depend on initial_data.c in the Makefile (i.e. depends on
  7809.   spell information). This is needed because of the promotion.c file which
  7810.   move.c now includes.
  7811.  
  7812. SPELL.C again. I just went over spell.c with my FTC (fine toothed comb) to
  7813. try and make it more efficient and save sapce.
  7814.  
  7815. * Removed 1 off counters for SpellRank array.
  7816. * Removed AddGUISpell as it was the same as AddSpecificSpell
  7817. * Made spell.c more likely to compile under Unix (except DrawImage call).
  7818. * Fixed potential bugs in board[-1] references
  7819. * Replaced various majic numbers with constants.
  7820. * Made use of Spells variable more logical.
  7821. * If io.c didn't use Spells then Spells could be made static.
  7822. * Most places using SpellTable[Player] in a loop have been simplified.
  7823. * The order of certain conditionals in computer spell selection has been
  7824.   changed for speed. Most conditions like if ((a or b) and c) are much
  7825.   better written if (c and (a or b)) because of short-circuiting eval
  7826.   of these expression, but great care must be taken in general because
  7827.   of implicit assumptions about ordering.
  7828. * Updated documentation in spell.c
  7829. * SpellProbability and DisplayedSpells are now static.
  7830. * Some trivial functions are now __inline (perhaps some of the simplest
  7831.   cases in predicate.c could benefit from this as well).
  7832. * MAX_SPELLS has moved from defines.h -> spell.h.
  7833. * Fixed a few type anomalies.
  7834. * These changes saved 1128 bytes in the developer version.
  7835.  
  7836. ENFORCER HIT: There was an inforcer hit on line 27 of text.c corresponding
  7837. to a call to Text (probably with an invalid char * pointer). Since this
  7838. occurred when I was experimenting with spell.c and it has not repeated I'm
  7839. ignoring it. NOW FIXED
  7840.  
  7841. MAKEFILE TESTING: I am now make an archive and doing a make from it to
  7842. test the new makefile. Okay, I had to make two minor changes, but basically
  7843. it worked. I've just noticed that my new makefile does not include options
  7844. for making anything other than "developer" version at present. I will do
  7845. this simply by including various option lines. Therefore to make a version
  7846. you will have to select the correct option lines from the top of the file.
  7847.  
  7848. * Improved make clean to delete .h and .c files which are automatically
  7849.   created.
  7850.  
  7851. * Changed the makefile to include options for the 68000 no editor release.
  7852. * Changed the makefile to include options for the 68020 release.
  7853. * Changed the makefile to incoude options for the demo versions.
  7854.  
  7855. NOTED: During compilation of release and demo versions there are many more
  7856. compiler warnings about unused variables. I can see two reasons for this:
  7857. First some are due to the optimizer (not a lot we can do about those), but
  7858. a few are due to #ifdef's not be present around some declarations where
  7859. they should be. There are also some warning about possible unitialized use
  7860. of variables, these ought to be checked more carefully as they are potential
  7861. bugs (if such usage ever actually happened).
  7862.  
  7863. IO BROKEN. Discovered that loading and saving is broken as a result of my
  7864. changes regarding wizards names. NOW FIXED.
  7865.  
  7866. Discovered that my changes to spell.c have caused some anomalies, in one
  7867. function I was returning a spell probability rather than a spell! Since
  7868. this code was replicated in 3 places in spell.c I implemented a new function
  7869. GetSpellFromProbability to make sure they are all homogeneous, now if there
  7870. is any problem with silly spells be granted there is only one place where
  7871. the code is likely to be wrong. This particular problem was the cause of
  7872. the enforcer hit noted above.
  7873.  
  7874. I had invertently damaged the Texas option, it now was trying to force you
  7875. to discard even when you have no spell left. FIXED.
  7876.  
  7877. BUG: I've noticed that when agent casting is turned on they will still
  7878. cast bad spells on their team mates when no other targets are available.
  7879.  
  7880. COMPLETED: I finished the implementation of the Passage spell. It is no
  7881. longer a wizard power-up but a single invocation. The code is rather like
  7882. that for PlasmaBeamHandler. This Wizard structure no longer has a "passage"
  7883. bit, changed all references to it accordingly. Note this will break io.c
  7884. even further, but I intend to fix that problem next. All spells in the game
  7885. are now up to date, the only object not yet functioning sensibly is the
  7886. "exit". In the mean time it behaves like a normal inanimate, so I'm just
  7887. leaving it like that for now.
  7888.  
  7889. IO REPAIRS: It turns out the problem with loading and saving games had
  7890. nothing to do with my name changes, but that the loading routine was broken
  7891. when presented with a name containing whitespace. The culprit has been
  7892. modified. Old files should still load (including some that would not before).
  7893. However, due to changes in the Wizard tags some wizard powerups will not be
  7894. encoded exactly the same, I don't expect this to create any problems,
  7895.  
  7896. DELETED Makechaos, stinkfile (was lmkfile), and MakeDemoOfChaos, they are
  7897. now all redundant.
  7898.  
  7899. CONSISTENCY IMPROVEMENT: When you select sound off from the game menu it now
  7900. turns off sound for the independents during both movement and casting. This
  7901. makes playing against 99 generators run considerable faster.
  7902.  
  7903. PASSAGE: Improved the comment on the Passage spell to reflect that fact
  7904. that a mounted creature or mediation can also make passage.
  7905.  
  7906. BUG: Wizards were not clearing wizards[].spell after using a spell. This
  7907. meant a wizard kept repearing the last spell selected when "coercion" was
  7908. in effect. While this was quite neat when it happened, it is not what is
  7909. meant to happen with coerced wizards. NOW FIXED.
  7910.  
  7911. BUG: Computer wizards (when either exposed or mounted) often choose not to
  7912. move. No problem with that. Except sometimes they are adjacent to enemies
  7913. cells and they still don't move. In such circumstances it would be logical
  7914. to at least make an attack OR an attempt to move away.
  7915.  
  7916. DELETED creature selection menus from editor and replaced them with a player
  7917. selection menu. Each player also has a hot key RA-1, RA-2, etc. so we have
  7918. the best of both worlds.
  7919.  
  7920. Did a "smake archive" and rebuild from the archive with no errors. Good.
  7921.  
  7922. Fixed another bug perhaps causing problems with warped wizards.
  7923.  
  7924. OUT OF TIME. Well I'm off to Australia on Saturday morning, so I am going to
  7925. send you the archive now, so I have 1 day to check you received it.
  7926.  
  7927. This is the current status:
  7928.  
  7929. * I addressed all bugs except those about IDCMP.
  7930. * I have still not throughly examined the situation with warped wizards.
  7931. * There may be new bugs in spell.c due to the extensive changes I made there.
  7932.  
  7933. ReleaseSemaphore(&SourceCode) 8-April-1999 by SAI
  7934. ObtainSemaphore (&SourceCode) 8-April-1999 by JC
  7935.  
  7936. * BUG: Place the mouse pointer over a cell or spell on the edge of the board.
  7937.   Now move the mousepointer to off the board and back.  The display is now
  7938.   blank (it doesn't say what you are pointing at).  You must first move to
  7939.   ANOTHER cell and then back.  This bug has been around for a long long time
  7940.   on the board and now it is there in the spell list also.  NOW FIXED.
  7941.  
  7942. * BUG: I am playing a game as player 2. When I put the mousepointer 1 pixel
  7943.   below the bottom left spell it says "Crocodile".  When I put it 1 pixel
  7944.   under the bottom right spell it says "Repulsion".  Even though there are no
  7945.   Crocodiles or Repulsions on the board, nor are those the next 2 spells in
  7946.   my spell list.  Oops I clicked the mouse button and now I've selected
  7947.   "Repulsion" as my spell!  Now I discarded the imaginary Crocodile.  Ok it
  7948.   really let me cast the Repulsion.  NEXT TURN: The bug is now gone. 
  7949.   NOW FIXED by tossing a -1 into the math equation.
  7950.  
  7951. * ADDED some new wizard names.
  7952.  
  7953. * BUG: Ok I'm playing a test game.  On turn 1 I vanished Player 8.  During
  7954.   the next spell selection I got that exact same enforcer hit in
  7955.   Chaos.c/GetSpellSelection/IntelligentComputerSpellSelect/IsExposedWizard
  7956.   that I reported before.  Now that I realize this is a problem with not
  7957.   checking the .warped bit all is NOW FIXED.
  7958.  
  7959. * FIXED the warped problem in sqDistanceFromNearestTeamWizard and
  7960.   sqDistanceFromNearestEnemyWizard now that GetWizardCell(p) returns -1 for
  7961.   a warped wizard.  Though maybe I should be checking the .warped bit
  7962.   instead.  I just don't know which method will be easiest to maintain.
  7963.  
  7964. BUG in the sasc "diff" command.  It can't handle files with extremely long
  7965. lines.  Numerous enforcer hits are generated and then the computer crashes.
  7966. Found by attempting to diff single.c with the previous version.
  7967.  
  7968. What is the purpose of all those CONST keywords that you added into text.c?
  7969.  
  7970. * EDITED descriptions of OgreWarrior, Ogre Assassin and Ogre Mage.
  7971.   Since the Ogre Mage description says he is trained in the medical arts I
  7972.   gave him special combat of -1 against life.
  7973.  
  7974. * Changed Texas Trade'em into Texas Trash'em since you don't trade spells
  7975.   in, you trash them (discard them).
  7976.  
  7977. * PROBLEM: when you cast a spell it tells you the range, which isn't very
  7978.   useful.  I would much rather know the multiplicity so I know how many
  7979.   attempts I get with the spell.  I've been wanting this feature since the
  7980.   first time I played the game years ago; I could never remember how many
  7981.   attempts of Justice, Dark Power and the various tree spells I was going to
  7982.   get. This made it difficult to plan where to cast my trees.  NOW FIXED.
  7983.  
  7984. * SHORTCOMING: Q key does not work on the spell list.  NOW FIXED.
  7985.  
  7986. * BUG: At the beginning of a person's movement phase there is text left over
  7987.   from the previous person's movement. NOW FIXED.
  7988.  
  7989. * 2 NEW SPELLS:  Magic Wand and Vodka.  Neither have a real graphic yet.  I
  7990.   won't make any graphics till I implement the graphics upgrade.  I just had
  7991.   to program these in real quick while I still remembered where to put the
  7992.   code fragments that make them work.
  7993.  
  7994. Hint to myself: If you add new stuff to the wizard structure then you must
  7995. do a smake clean or there will be all kinds of horrible, strange and even
  7996. humorous bugs (like computer wizards suddenly becoming human wizards,
  7997. humans getting to pick computer wizard's bonus spells for them, and dead
  7998. wizards that still cast spells).  Found this all out the hard way.
  7999.  
  8000. ************************************* TEST GAME ************************
  8001.  
  8002. I'm playing a test game as player 2 against all the computer controlled
  8003. wizards.
  8004. Turn 1: Player 1 casts Plasma Beam on nobody.  Moves away from his enemies.
  8005. Turn 2: Player 1 casts Plasma Beam on nobody.  Moves away from his enemies.
  8006. (he is now on the edge of the screen).
  8007. Turn 3: Player 1 casts Plasma Beam on nobody.  I guess he is attempting to
  8008. move off of the board because now there are zillions of enforcer hits then
  8009. the game locked up.
  8010.  
  8011. All the other wizards and creatures acted normal.
  8012.  
  8013. The enforcer hits didn't put cpr on a line of code.  It just put it on some
  8014. assembly code, presumably because the hit happened in an OS routine.  So I
  8015. have NO idea what was causing all this. 8(
  8016.  
  8017. NEXT TIME I PLAY A GAME SAVE IT EVERY TURN!
  8018.  
  8019. All this was caused by an uninitialized variable. When I added the Vodka
  8020. spell I made a new variable "wavy". I had:
  8021.  
  8022. UBYTE wavy; instead of the correct UBYTE wavy=0;
  8023.  
  8024. So the wavytask was being stopped even though it wasn't running.  This
  8025. resulted in memory being freed which hadn't ever been allocated in the
  8026. first place.  A really good way to crash the computer.
  8027.  
  8028. It was all just a simple little mistake. ALL FIXED NOW.
  8029. **************************************************************************
  8030.  
  8031. * BUG: Computer players keep casting Demonic touch and then aborting it even
  8032.   though there are low-combat creatures nearby! NOW FIXED.
  8033.  
  8034. * REDUCED Thundermare combat to 12.
  8035.  
  8036. * BUG: I just killed a wizard and for my bonus spell I picked the Crimson
  8037.   Death. It says its probability is 226% instead of -8% like it is supposed
  8038.   to.  NOW FIXED.
  8039.  
  8040. * BUG: the "q" key no longer works on the alt-o spell list like it used to.
  8041.   I found this by pressing alt-o in the editor.  Then I clicked on the Ghost
  8042.   which showed me a list of all undead flying creatures.  I wanted to read
  8043.   the description of the Crimson Death but the Q key did not work. 8(
  8044.   Fixed by SAI. NOW FIXED.  But OOPS I actually wanted to see the stats of
  8045.   the creature, not read its spell-description.  Maybe we should have "q" and
  8046.   "Q" in the editor?  ???
  8047.  
  8048. * BUG: the 2nd tier of alt-o objects does not erase the first tier like it is
  8049.   supposed to.  Fixed by SAI.
  8050.  
  8051.  
  8052. **** Another Playtest game *****
  8053. Somehow there is a sleeping lion that is being ridden by a computer wizard.
  8054. The lion just moved.  Then it cast a Griffon. I don't know how that happened.
  8055. The mounted wizard has Irvine's invulnerability.  Couple of turns later:
  8056. now the lion has died and there is an empty cell that says
  8057. Nothing (Torquemada) has 31 life, 7 recovery, 4 MR, 15 Man, 15 Intelligence
  8058. and 1 combat. It says that all its original stats were 0.
  8059. It has the following wizard powerups:
  8060. Invulnerability, Recover Boost, Elf Boots, Brain Boost, Armor.
  8061. I don't know what caused this and I don't know how to fix it.
  8062. ********************************
  8063.  
  8064. * BUG: A sleeping Vortex is moving around the board!  NOW FIXED.
  8065. * Vortex description no longer says it leaves a trail of distorted space in
  8066.   its wake.
  8067.  
  8068. **** JCformat Rules! ***********
  8069. I had a mysterious error from the C compiler like this:
  8070.  
  8071. void HandleMOUSEMOVE(int mx, int my, int sp)
  8072. chaos.c 2380 Error 218: declaration found in statement block
  8073.  
  8074. I looked at the code prior to this line and couldn't see the problem.
  8075. I was even looking directly at the area of code where the problem was but
  8076. didn't see it for whatever reason.  Then I used JCformat on chaos.c
  8077. and it told me: Error in line 2235: Ending does not match beginning.  Thus
  8078. I fixed the problem within 5 seconds of running JCformat when in the olden
  8079. days before JCformat I'd have gotten frustrated and just went off and
  8080. watched some tv to take a break and would have lost hours of productivity.
  8081. *********************************
  8082.  
  8083. * NEW FEATURE: The "c" key now works on your spell list!  I've been wanting
  8084.   this feature for years.  Now that I've got it, it is totally cool!  You
  8085.   can _instantly_ determine all the potential targets of any spell in your
  8086.   list.  This is so much easier than having to read the 2nd info screen of
  8087.   a spell to see if it is allowed to be cast on certain types of things (like
  8088.   growths or inanimates or corpses) etc. etc.
  8089.  
  8090. * UPDATED THE DOCS for "c" key and multiplicity.
  8091.  
  8092. Monday, April 12th, 1999: New phone line installed.  I now have reliable
  8093. 24 hour access to the net.  If the Chaos internet upgrade was completed
  8094. today I could immediately start running a full-time internet game server.
  8095.  
  8096. **************************************************************************
  8097.                     ALGORYTHMIC SPEECH UPGRADE
  8098. **************************************************************************
  8099. * BUGS: The speech for Lich Lord and ShapeChanger doesn't work due to a
  8100.   typographical error in the phonetic spelling.  All these years I thought
  8101.   you had intentionally left out speech for the ShapeChanger.  Oh well,
  8102.   its NOW FIXED.
  8103.  
  8104. * FIXED the awful pronunciation of "Justice", "Castle", "Confidence",
  8105.   "Coercion", Ogre", "Ogre Mage", Ogre Assassin", "Ogre Warrior" and
  8106.   "Falcon".  Justice had been pronounced "Justayce" for years and "Falcon"
  8107.   had been pronounced "Foilcon" for years. NOW FIXED.
  8108.  
  8109. * PROBLEM: the spell manager issues warnings when I put a period at the end
  8110.   of a phonetic string.  There should not be a warning for this. Erroneous
  8111.   warnings are also issued for the chars: ,()?   NOW FIXED.
  8112.  
  8113. * IMPROVED PRONUNCIATION of ALL SPELLS.  I should have done this years ago,
  8114.   its so easy.  And I only intend to use the algorythmic speech for a few
  8115.   more months before I replace it with digitized speech.  Oh well.  There
  8116.   were just sooo many spells which were using 1 or more wrong phonemes.
  8117.   Certain spells had the correct phonemes but had the stress reversed
  8118.   (stress on 2nd syllable when it was supposed to be on the first or vice
  8119.   versa.)
  8120.   Almost every single spell file has changed now. COMPLETED.
  8121.  
  8122. Certain words like Agathion, Achiyalabopa, Abath, Amphisbaena, Bodak,
  8123. Hybsil, etc. are not
  8124. in my dictionary and I have never heard them spoken by a human being before
  8125. so I really have no idea how they are supposed to be pronounced.  I'm just
  8126. leaving mysterious words like this unchanged.
  8127.  
  8128. Apparently people in New Zealand don't pronounce the letter "r".
  8129. I found many words, e.g. "Wizard" which simply had no "r" phoneme in them
  8130. like as if you had intentionally removed it.  Since we americans pronounce
  8131. our "r"'s I have changed this.  Example: "WIH4ZAXD" is now "WIH4ZERD".
  8132. Similar for "Vampire" and "Vulture".
  8133. If you don't like this we'll have to have an option for "American Speech"
  8134. and "New Zealand" speech.
  8135.  
  8136. Some spells like Aviary didn't even have speech.  Now they do.
  8137.  
  8138. I didn't change the speech for Goblin Bomb and Hidden Horror so that people
  8139. can sneakily cast them without their opponents noticing. hehehe.
  8140.  
  8141. **************************************************************************
  8142.  
  8143. * PROBLEM: We were playing a multiplayer game.  At some point while most of
  8144.   us were out of the room somebody moved some stuff around on the table by
  8145.   the keyboard.  This resulted in a joystick falling onto the keyboard and
  8146.   resting on the return key.  This made everyone end their turn at about 1
  8147.   second intervals.  I know this isn't much of a _real_ problem but still...
  8148.   I have now implemented End of Turn Confirmation. NOW FIXED.
  8149.  
  8150. * End of Turn Confirmation addresses Joseph Dixon's complaint about the
  8151.   end-of-turn gadget being at the bottom of the screen and JJ's complaint
  8152.   about it being at the top of the screen.  It no longer makes any
  8153.   difference where it is since if you accidentally press it it will still
  8154.   bring up the requester and ask if you are sure you want to end your turn.
  8155.  
  8156. ******** CastInfo + Spells Upgrade **************************************
  8157. NOTE to SAI: In my opinion there should be CAST_NOWIZARDCELL and
  8158. CAST_NOEXPOSEDWIZARD flags for IsIllegalCast to test.  This would allow us
  8159. to simplify the hints of certain spells since hints are not needed to
  8160. prevent something that is illegal in the first place.  The reason I want
  8161. this is that if you point the mouse at the "Free" spell in your list and
  8162. then press "c" it highlights all the wizards on the board even though that
  8163. is a guaranteed failure.  Such bits would improve the gameplay, usage and
  8164. implementation of Alter Reality, Betrayal, Dark Power, Exorcise, Free,
  8165. Kill, Nuke, Sleep, Subversion and Wake.
  8166.  
  8167. * Now Implemented aforementioned CAST_NOWIZARDCELL and CAST_NOEXPOSEDWIZARD
  8168.   bits into CastInfo.
  8169.  
  8170. * CastInfo[] is now ULONG instead of UWORD.  I had to make a small change
  8171.   in spellman.tex to accomadate this.
  8172.  
  8173. * Betrayal, Free and Subversion can no longer be cast on Artifacts.
  8174.  
  8175. In my opinion, if a spell is guaranteed to fail on a certain type of cell
  8176. then there should be a CAST_BIT for that in the CastInfo[] array.
  8177.  
  8178. * FLAW c key on Raise Dead says you can cast it on your own wizard!
  8179.   We probably either need a CAST_NOLIVING bit or a CAST_MUSTBEDEAD bit.
  8180.   This problem is solved below.
  8181.  
  8182. * AAAAAAAAAUUUUUGGGGHHHHH!!!! MAJOR BUG!!!  I just played a test game and I
  8183.   just cast Raise Dead on an enemy wizard.  The Enemy wizard wasn't dead.
  8184.   He is now MY wizard and he's undead!
  8185.   You can also cast Raise Dead on your own wizard to make him suddenly
  8186.   become undead!   This is all caused because of the
  8187.   lame way of defining classes of objects according to the highness or
  8188.   lowness of their ID number.  Someday I'll go through and eliminate all that
  8189.   stuff like I've been wanting to do for years.  But for now I'll just hack
  8190.   in a quick fix. NOW FIXED.
  8191.  
  8192. * Ok now I've removed all that ID checking code crap and replaced it with
  8193.   IsCreature(cellp) instead.  Well how about that, there are no
  8194.   isCreature(cell) or IsCreature(cellp) macros.
  8195.  
  8196. * NEW MACROS isCreature(cell) and IsCreature(cellp) and isIDcreature(id)
  8197.  
  8198.  
  8199. NOTE: The game is a database.  Therefore all data should be contained in
  8200. the database and not in any way be dependent on the numerical value of the
  8201. ID number being above or below some other numerical ID number.
  8202.  
  8203. All occurences of things like:
  8204.  
  8205.  IF somethingID <= ImpID
  8206.  should be replaced with something like:
  8207.  IF isIDCreature(somethingID)  //  or IF isCreature(cell) // or IF IsCreature(cellp)
  8208.  
  8209. * REPLACED all occurrences of > ImpID with the appropriate creature macro
  8210.        and all occurrences of <=ImpID with the appropriate creature macro
  8211.  in cast.c, all spell files, move.c, and some of the ones in spell.c
  8212.  
  8213. * Note to SAI:  As I was doing the above I found some code in cast.c that can
  8214.   never be executed.  You should probably look at it.  Just search for
  8215.   the LAST occurrence of CatLordID and you'll see it. SAI Fixed the code.
  8216.  
  8217. * There are still numerous occurrences of ImpID sprinkled around in various
  8218.   files but some of them look like they might be using it in a strange way so
  8219.   I didn't mess with them + I'm very sleepy at the moment.  I'll leave the
  8220.   others for SAI.  ALL occurences of ImpID have now been replaced by SAI
  8221.   except for the ones in spellman.tex and reincalc.c.
  8222.  
  8223. The ultimate goal is that someday there should be no references of > someID
  8224. or < someID.
  8225.  
  8226.  
  8227. Ok, now the game is completely messed up.  I just now found out the hard
  8228. way that InitialData[] only exists up to the highest numbered inanimate
  8229. object.  So the isIDcreature macro doesn't work when given a magic spell id.
  8230. (For example the game thinks the VodkaID is a creature when in fact it
  8231. is just a magic spell like Teleport.)
  8232.  
  8233. Ok, but the isCreature and IsCreature macros seem to be working ok.
  8234.  
  8235. * CHANGED isIDmacro from:
  8236.  
  8237. #define isIDcreature(id)       ((InitialData[id].Stat & CREATURE_STAT))
  8238. to
  8239. #define isIDcreature(id) (id<=Wizard8ID and InitialData[id].Stat & CREATURE_STAT)
  8240.  
  8241.  
  8242. **************************************************************************
  8243.  
  8244.  
  8245. ****** Artifact + Sleep Problems **************************************
  8246. Casting sleep on an artifact puts it to sleep but since its owner is
  8247. calculated right after that, it never says that it belongs to ASLEEP.
  8248. Thus you cannot see if it is asleep or not.
  8249.  
  8250. If someone casts sleep on an artifact that belongs to you it will be
  8251. technically put to sleep (so it will collapse at some point) but it will
  8252. still belong to you and you can still attack with it.
  8253.  
  8254. * SOLVED by modifying CalculateArtifactOwners to ignore sleeping artifacts.
  8255. ***********************************************************************
  8256.  
  8257. * REMOVED Temporarily all the ADPCM code from the game since I probably
  8258.   won't really use it for a few more months till the OS2.04+ version and to
  8259.   save memory on the FINAL 1 meg version.
  8260.  
  8261.  
  8262. ********** Major playtest game of Jerry vs. James. ********
  8263. Jerry started with 3 wizards on his team 2 were controlled by him and a 3rd
  8264. was computer controlled.  I started with 2 wizards on my team controlled by
  8265. me.  The remaining 3 wizards were all computer controlled and on their own
  8266. team.  No artifact, no scrolls, no Texas Trash'em, 3 generators.
  8267.  
  8268. * BUG: Sometimes computer controlled wizards attack their ally's
  8269.   creatures.  This only applies to computer controlled _wizards_.  The
  8270.   Creatures of the wizard don't get engaged to or attack allies, only the
  8271.   wizard himself.  Basically computer wizards are trying to mount their
  8272.   ally's mountable creatures.  The problem was in ChooseDestination
  8273.   NOW REWRITTEN AND FIXED.
  8274.  
  8275. BUG: I'm not sure what I did but I may have rapidly hit the lmb then rmb
  8276. near the top of the screen (but I don't think I was in the menu area, more
  8277. like the 1st or 2nd row of cells).  The game then said "Mind Flayer" even
  8278. though there were no mind flayers on the board and in fact the ENTIRE area
  8279. of the board that I clicked in was completely empty.  It said I had 0
  8280. movement points and I couldn't moved or cancel or do anything 8(
  8281. Essentially the game was locked up since I couldn't really do anything.
  8282. This happened in a really important game between myself and my brother.
  8283. Luckily I was running the game under cpr so I hit escape and single stepped
  8284. through the code and FORCED the new_cell variable to be USER_RMB which
  8285. cancelled my turn.  I guess this proves that the RMB was being trapped when
  8286. it wasn't supposed to.  Anyway, once I did that the game proceeded
  8287. normally.  I remember seeing this bug before a very long time ago. Perhaps
  8288. 1 or 2 years ago.  I may have just exited from an info screen right when
  8289. this happened.  I don't know for sure.  Leaving this for SAI.
  8290. JC fixed this bug months later in November 1999.
  8291.  
  8292. * BUG: Somtimes computer wizards cast Plasma Beam for 2 or 3 turns in a row
  8293.   on empty space.  Leaving for SAI.  Fixed by JC months later on October
  8294.   20th 1999.  NOW FIXED.
  8295.  
  8296. Jerry cast Triple on the first turn so I cast Coercion on the first turn to
  8297. negate that.  However, he was coerced for 3 or 4 turns but this apparently had
  8298. NO EFFECT on his Triple spell once the coercion wore off.  When the coercion
  8299. wore off, he still had his triple in force for a long long time thereafter.
  8300. Is that the way it is supposed to work?
  8301.  
  8302. I always thought that spells like Triple work for a set number of game
  8303. turns, regardless of other effects.
  8304.  
  8305. We found out that many spells, like Torment and Coercion, hurt your allies
  8306. as well as your enemies.  Is that the way it is supposed to work?
  8307.  
  8308.  
  8309. **************************************************************************
  8310. TORMENT BUG #1:
  8311. My wizard cast Torment and it lasted a few turns for each wizard, including
  8312. my Ally wizard.  So I simply didn't cast any creatures for a few turns,
  8313. waiting for it to wear off.  But it didn't wear off so I waited a few more
  8314. turns.  This went on for around 10 turns and it never wore off so I figured
  8315. it must be set to last for at least 1 creature cast so I cast a tormented
  8316. creature and sure enough that triggered the removal of the torment.  The
  8317. spell description says "... the effect will hold for several turns of each
  8318. wizard". 
  8319.  
  8320. So either 
  8321. A) The spell needs to be reprogrammed to really work for several TURNS or
  8322. B) We need to change the docs to say "creature casts" instead of "turns".
  8323.  
  8324. * TORMENT description changed to say that it works for several
  8325.   "creature casts".
  8326.  
  8327. TORMENT BUG #2:
  8328. The Torment spell description says that it influences the creature casts of
  8329. "the opposition" when in fact it influences the creature casts of ALL other
  8330. wizards including your allies.  So we need to either:
  8331. A) Change the description to say "all other wizards" or
  8332. B) Reprogram the spell to really only work on opposition wizards.
  8333.  
  8334. * TORMENT description changed to say that it affects "all the other wizards"
  8335.  
  8336. * COERCION description changed to say that it affects "all the other wizards"
  8337.  
  8338. I'm not saying this is how I want Torment et.al. spells to work.  You made
  8339. the spell so its up to you. I don't know how they "should" work, nor do I know
  8340. if it even makes any difference. I'm just saying what I have done for the
  8341. time being to correct the incongruencies.  However a spell works, its
  8342. description should be accururate and not misleading.
  8343. ****************************************************************************
  8344.  
  8345.  
  8346. WEIRD BUG: I cast a tormented Crocodile.  At some point (1-3 turns later) the
  8347. crocodile mysteriously healed back to full life!  The same thing happened
  8348. to all 3 of Jerry's tormented Vultures!  How is this possible?
  8349. Leaving for SAI.
  8350.  
  8351. * BUG: Jerry cast Restoration on my cloaked wizard and it technically removed
  8352.   the cloak but it never redrew the wizard, so for the rest of the game it
  8353.   looked like he was cloaked on the board, but in fact was not. NOW FIXED.
  8354.  
  8355. * BUG: Jerry cast "Orcs" while having a Magic Wand so I told him to press
  8356.   the "c" key to see where all he could cast his orcs but the "c" key didn't
  8357.   work! It doesn't seem to work on any multiplicity spells. NOW FIXED.
  8358.  
  8359. BUG: "c" key over an Orcs spell in your spell list highlights your wizard
  8360. and NOTHING ELSE.  This is because the Orcs spell is defined as CAST_FREE.
  8361. Something needs to be done about this so that all multiplicity spells will
  8362. correctly highlight all the legal cells like they are supposed to.
  8363. Leaving this for SAI.
  8364.  
  8365. It was an extremely close game up until turn 20.
  8366.  
  8367. Game over on turn 30.  Jerry killed me.  I don't think he could have killed
  8368. the independents though, as there was a Devil walking around + other stuff.
  8369. ***************************************************************************
  8370.  
  8371. * FINAL 1 MEG VERSION DONE on April 19th, 1999.  The disk is 99% full with
  8372.   only 9 blocks left.  Here is a list of the main floppy dir.
  8373.  
  8374. Directory "df2:chaos" on Monday 19-Apr-99
  8375. fonts                        Dir ----rwed 01-Dec-98 19:25:17
  8376. Music                        Dir ----rwed 16-Jan-99 14:29:53
  8377. talklists                   9354 ----rwed 14-Mar-99 09:52:32
  8378. Chaos                     343076 ----rwed Today     20:17:05
  8379. chaos.prb                   6800 ----rw-d Today     16:48:00
  8380. classic.prb                 6543 ----rw-d Today     16:48:00
  8381. pool.ssc                   43545 ----rwed Today     16:58:57
  8382. Start_Chaos                  311 ----rwed 31-Mar-98 05:49:42
  8383. Start_Chaos.info            2570 ----rw-d 01-Dec-98 20:10:17
  8384. chaos.dat                  66688 ----rwed Today     17:02:00
  8385. 8 files - 2 directories - 953 blocks used
  8386.  
  8387. Memory Consumption during Intro:
  8388. Chip RAM:  467608
  8389. Fast RAM:  382376
  8390.  
  8391. Memory Consumption during Setup:
  8392. Chip RAM:  459224
  8393. Fast RAM:  469624
  8394.  
  8395. During the game:
  8396. Chip RAM:  267000
  8397. Fast RAM:  482728
  8398.  
  8399. During info screen:
  8400. Chip RAM:  281000
  8401. Fast RAM:  483384
  8402.  
  8403. During the "About" Requester:
  8404. Chip RAM:  369000
  8405. Fast RAM:  483488
  8406.  
  8407. During the "Save As" Requester:
  8408. Chip RAM:  299400
  8409. Fast RAM:  486952
  8410.  
  8411. During the "Quit Game" Requester:
  8412. Chip RAM:  317800
  8413. Fast RAM:  483344
  8414.  
  8415. * PLAYED 1 test game on 7Mhz 68000.  Everything seemed to work ok, but the
  8416.   "End Turn" confirmation was too slow.  Oh well.
  8417.  
  8418. * Chaos_2.5r and Chaos_2.5d are both in /ChaosArchives/ directory.
  8419.  
  8420. * Uploaded v2.5d demo version to Aminet.  Upload rejected as usual.
  8421.  
  8422. * Worked on music for several days then:
  8423.  
  8424. **************************************************************************
  8425.  
  8426.       HARD DRIVE CRASH!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  8427.  
  8428.       ALL PARTITIONS LOST !!!!!!!!!!!!!!!!!!!!!!!!!!
  8429.  
  8430.       DAY OF DOOM!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  8431.  
  8432.       AAAAAAAAAUUUUUUUUUUUGGGGGGGGGGGGHHHHHHHHHH!!!!!!!!!!!!!
  8433.  
  8434. I can't access the source code, my word processor, my email, the internet,
  8435. the compiler.... NOTHING...
  8436.  
  8437.  
  8438. This was EXTRA bad because I'm using an Amiga 3000 with the ROM in a file
  8439. in DEVS:Kickstart, which means if the hard drive doesn't work then neither
  8440. does the computer.
  8441.  
  8442. After getting really depressed for a couple of days I finally started
  8443. looking for my old 120 meg HD that used to be in my A3000.  That took an
  8444. entire day and I was unlucky enough that it was in the LAST place I looked.
  8445. (as in I gave up because I had looked EVERYWHERE except this one last box,
  8446. it was the only thing I hadn't looked through... well whaddayaknow there it
  8447. was.)
  8448.  
  8449. Ok, so I put the old drive in and I could at least boot up my amiga.
  8450. LUCKILY I was smart enough to have installed some basic internet software
  8451. on that drive before removing it and throwing it in the shoebox or I would
  8452. REALLY have been dead in the water.  Unfortunately I had only tcp/ip and
  8453. irc installed. So no web browsing or ftping for me. 8(
  8454.  
  8455. It was like being teleported back in time to 1989 8(
  8456.  
  8457. Well after talking to numerous people on the net and doing lots of research
  8458. about hard drives for a whole week, I finally figured out the problem and the
  8459. solution.
  8460.  
  8461. The problem was: The original AmigaDOS had a limit of a 4gig drivesize.
  8462. (I had thought it was a 4gig partition size).  That's right, in 1985 when
  8463. Bill Gates compatible PCs had a 40 meg limit, the Amiga had a 4096 megabyte
  8464. limit.  The amiga has a 32-bit operating system and the largest number that
  8465. a 32-bit number can hold is exactly 4 gigs.
  8466.  
  8467. WHAT HAPPENED: When I wrote a file to the hard drive it "wrapped around"
  8468. from the 4gigth block to block 0 and overwrote the Rigid Disk Block and
  8469. associated data blocks that keep track of what partitions are on a drive
  8470. and where they are located.  This happened because the HIGHEST partition is
  8471. my WORK partition of 1.6 gigs size and this is the one I put all my stuff
  8472. in.  It was 49% full at the time of the crash.
  8473.  
  8474. The solution is any 1 of the following:
  8475. A) Don't use drives of larger than 4 gigs.
  8476. B) Use drives of larger than 4gigs but don't actually use more than 4 gigs
  8477.    of its space.
  8478. C) Upgrade to the newest FFS (FastFileSystem) which is 64 bit.
  8479.  
  8480. Since my drive was already formatted under the old FFS I just took the easy
  8481. way out and did option B.  I repartioned my drive to not use the upper 20
  8482. megs of space.  Losing 20 megs out of 4,300 megs is irrelevant.
  8483.  
  8484. HOW I RECOVERED MY DATA:  I just used RDB-Salv from Aminet which went in
  8485. and figured out where my partions were, how big, etc.  It worked perfectly
  8486. on the first try.  Then I repartioned my drive with HDtoolbox to the
  8487. correct specifications (the exact same ones as when I set it up
  8488. originally).  Then I used DiskSalv from Aminet to salvage all files off the
  8489. 1st partition.  The 1st partition is my boot partition with workbench and
  8490. it was partially overwritten in the crash.
  8491.  
  8492. Disksalv recovered EVERY file except for 3.  1 of the files was easily
  8493. replaced from its original source.  The 2nd file was just some useless
  8494. program I had downloaded once upon I time so I just deleted it.  And the
  8495. 3rd file was a mysterious unknown and unused file of complete irrelvance to
  8496. anything (I guess it was left over from some old program I once deleted).
  8497.  
  8498. There were numerous other small problems that arose from me switching my
  8499. hard drives around, these were related to improper SCSI termination (since
  8500. I don't have the manual to the 120 meg drive) and to not doing "save
  8501. changes" in HDtoolbox.
  8502.  
  8503. Recovery operation completed on May 15th, 1999.  For the previous 12 days
  8504. no work was accomplished on Chaos and I got really stressed out.
  8505.  
  8506.  
  8507.             HARD DRIVE REPAIRED
  8508.  
  8509. ***************************************************************************
  8510.  
  8511. ***************************************************************************
  8512. JJ BUG REPORTS on v2.5r:
  8513.  
  8514. * BUG: Game does not work.  This turned out to be because he had renamed
  8515.   the game dir to "Chaos 2.5" and the path determination code couldn't handle
  8516.   spaces.  This never would have happened if we had made the game require
  8517.   OS2.04 or higher since then we'd just use PROGDIR:   NOW FIXED.
  8518.  
  8519. -------------------------------------------------------------------------
  8520. * LOAD/SAVE BUG: If you save a game with wizards in trees then reload it
  8521.   there is a MAJOR problem: When the tree collapses the wizard is invisible
  8522.   and "he's there but not really there" which makes him impossible to kill.
  8523.   Ok, this was because the WizardInfo structure said UBYTE id instead of
  8524.   UWORD id. NOW FIXED.
  8525.  
  8526. * LOAD/SAVE BUG STILL THERE: The loading and saving routine had the
  8527.   following problems:
  8528.  
  8529. From the Load Routine:
  8530.  
  8531. // j is an int so this doesn't work right.
  8532. // This reads the wizard id into the upper word of the int j so the id
  8533. // will ALWAYS be wrong.
  8534.            fread ((char *)&j, sizeof(USHORT), 1, fh);
  8535.            wiz->id = FileCode[j];
  8536.  
  8537. From the save routine:
  8538. // j is an int so this doesn't work right
  8539.      j = InternalCode[wiz->id];
  8540.      fwrite ((char *)&j, sizeof(USHORT), 1, fh);
  8541. // This Writes out the upper word of the int (which is always 0)
  8542.  
  8543.    ALL NOW FIXED.
  8544. --------------------------------------------------------------------------
  8545.  
  8546. When he saves a game it says "save complete" but then the hard drive
  8547. flashes a few seconds later.  He thinks that if you don't WAIT for this to
  8548. happen that it messes things up.
  8549.  
  8550. * COMPLAINT: He always plays as player 8 so when he saves the game he has to
  8551.   WAIT for all the first 7 wizards to reselect all their spells. Therefore
  8552.   he doesn't bother saving the game anymore since its too annoying.
  8553.  
  8554.   This same thing has been bothering me (JC) for some time now but since I
  8555.   always play as player 1 or 2 it didn't bother me badly enough to try to fix
  8556.   it.  I was going to fix this problem when I add internet capability to the
  8557.   game since the current gamesave just WON'T work with internet play.
  8558.   It must be modified to allow for saving at ANY person's spell-selection
  8559.   point, not just player #1's.
  8560.   But since it is such a problem for JJ we might need to fix it sooner.
  8561.   TEMPORARILY BAND-AID PATCH FIXED by reducing BASE_DELAY from 2 seconds to
  8562.   2 tenths of a second.  IMPLEMENTED.
  8563.  
  8564.  
  8565.  
  8566. save at beginning of spell selection phase.=YUK.
  8567.  
  8568. * MAJOR BUG: highlight ? with mouse then click on some cells.  It will lock
  8569.   up quite frequently.  Usually happens with cells on the upper right of the
  8570.   board. 
  8571.  
  8572. Note from JC:--------------------------------------------------------
  8573. I have now verified that this bug is NOT caused by his Qmouse Mouse
  8574. accellerator.  It is in fact caused by a bug in OS 1.3 and below.  It
  8575. happens when pressing the mouse button (the right one I think) in the dead
  8576. area between the 2 screens on the information panels.
  8577.  
  8578. I absolutely, positively DO NOT have this bug on my A3000 with OS 3.1.
  8579.  
  8580. There may be a work around for this but I don't care.  Its just another
  8581. good reason to hurry up and make the game require OS 2.04 or higher.
  8582. ---------------------------------------------------------------------
  8583. ABOVE BUG NOW FIXED on OS 1.2 / 1.3 by hacking in some "IF OS <= 1.3 THEN
  8584. TrapRMB" code.
  8585.  
  8586. * MAJOR BUG: Right Mouse Button on load/save screen under OS 1.3 locks up the
  8587.   program.  This is caused by the fact that the requester opens its own
  8588.   window without the TRAPRMB bit set.  I don't know any way to make the
  8589.   requester open a TRAPRMB window.  So we need to work around this bug some
  8590.   other way or just require OS 2.04 or higher.  OK, I have simply turned
  8591.   off the MENUVERIFY feature for the HiResWindow during the loading and
  8592.   saving screens and now it works perfectly under OS 1.3.  NOW FIXED.
  8593.  
  8594. * MOVED TrapRMB and PassRMB #defines from chaos.c into defines.h
  8595.  
  8596. * COMPLAINT: he puts in the wizard names for each player with a number on
  8597.   the end to indicate their player number.  Then he plays a game.  Whenever
  8598.   he starts a new game it then RE-randomly generates all the names over again
  8599.   and he has to re-enter the numbers on the end.  Ok, I have now fixed this
  8600.   so that names are only randomly generated once when you first load the game
  8601.   and then never again.  NOW FIXED.
  8602.  
  8603. END OF JJ Bug Report.
  8604. **************************************************************************
  8605.  
  8606. * FLAW: A human wizard can no longer attack a tree that is occupied by
  8607.   another wizard.  It just says "already occupied".
  8608.   I Changed this to not attack if the tree is occupied by an ally, otherwise
  8609.   attack the tree even if the tree itself is on your team.  Ditto for all
  8610.   meditations.  This change does not affect computer wizards and does not
  8611.   allow any of your own creatures to attack your own meditations.
  8612.   NOW FIXED.
  8613.  
  8614. * NEW FUNCTION GetWizardCodeSameTeam to support above feature.
  8615.  
  8616. * SPEEDED UP: Lissajous box menu thingies.
  8617.  
  8618. * BUG: I move my player 2 wizard into my ally's dark citadel and now I can't
  8619.   move him out!  He's trapped!  This was caused by the the fact that the
  8620.   "clear movement bit" code was OUTSIDE the main loop!  So the MOVED bit was
  8621.   only being cleared after all players had moved!  Thus I never noticed this
  8622.   since for player 1 (who I usually play) the MOVED bit was properly cleared.
  8623.   But for ALL other players the MOVED bit was set totally wrong.  I went back
  8624.   and looked at all the old source code versions on my HD and they all have
  8625.   this same bug! ack.  NOW FIXED.
  8626.  
  8627. * Compiled a new v2.5 and this is REALLY the final 1 meg version.
  8628.  
  8629. Around June 1, 1999?
  8630. * My car blew up.  No work accomplished for 2 weeks.
  8631.  
  8632. * bought a used car.  It broke down within 24 hours.  No work accomplished.
  8633.  
  8634. * My mom's car broke down.  No work accomplished.
  8635.  
  8636. * CHANGED: Killing a generator now allows you to pick from 4 bonus spells
  8637.   instead of only 2; thus reflecting the extreme difficulty of killing a
  8638.   generator.
  8639.  
  8640. * BUG: Computer wizards cast vodka on artifacts a lot, this effectively wastes
  8641.   the vodka spell. I have now simply removed the CAST_ARTIFACT from the
  8642.   CastInfo field so this is NOW FIXED.
  8643.  
  8644. Alleged Bug:  I just cast Seperation on a cloaked computer wizard and it
  8645. didn't seperate him!!!  He is still in an alliance with all the other
  8646. computer wizards!!!!!  No, that is just the way the spell works.  You don't
  8647. cast it ON anyone.  It is a cast_free spell that just seperates yourself.
  8648.  
  8649. * BUG: If you save the game while Tormented, then reload, you suddenly have
  8650.   a MagicWand and Vodka powerup.  NOW FIXED.
  8651.  
  8652. * BUG: Depth removes line-of-sight requirements but its description says
  8653.   it is only supposed to allow unlimited range without changing line of
  8654.   sight requirements.  This is due to a limitation in the spellcasting engine
  8655.   that any spell with max range automatically does not require line of sight.
  8656.   There is currently NO WAY to have a spell have unlimited range yet require
  8657.   line of sight.  So we need to either reduce the range of Depth down to 14
  8658.   and edit the description accordingly, or we need to change the description
  8659.   of depth to say that it removes line of sight requirements also.  Or we
  8660.   could change depth to be that it doesn't change range but it removes line
  8661.   of sight requirements.  Or ???
  8662.  
  8663.   OK, here is what I did: I changed the Depth description to state that you
  8664.   get unlimited range + you don't need line of sight.
  8665.  
  8666. * NEW SPELL: Crystal Ball.  This spell removes line of sight requirements
  8667.   for all spells.
  8668.  
  8669. * NEW SPELL: Ubiquiscope.  The Ubiquiscope is like a combination of Crystal
  8670.   Ball + Magic Wand.
  8671.  
  8672. * 11 NEW SPELLS: Fly, Singular Earthbind, Dual Earthbind, Nonarchery, Convert,
  8673.   Sword of Sassenrath, Cursed Sword, Mount, No Mount, No Grow, The Exorcist.
  8674.  
  8675. I haven't made any new graphics for any of my new spells.  I'm hoping this
  8676. will help motivate me to do the graphics upgrade. The only exception is The
  8677. Exorcist which I pirated the graphics from the Bandit and made the Bandit
  8678. use the graphics from the Annis, then I deleted the Annis since it didn't
  8679. seem to have any real purpose. The Exorcist still needs to be redrawn so
  8680. that he is holding a cross in his hand.
  8681.  
  8682. BUG in Spellmanager: The following lines from Ubiquiscope cause a fatal error:
  8683. ComputerAssist:
  8684. Imagery:    STATIC
  8685. Leave this for SAI.
  8686.  
  8687. BUG in something: When processing the 2nd image of the new animated bandit
  8688. the compilation stops with "Invalid Section Code".  I have temporarily
  8689. worked around this by making the bandit be STATIC once again.  Leaving this
  8690. for SAI to fix.
  8691.  
  8692. -------------------------------------------------------------------------
  8693. I stayed up all night playing a serious game.
  8694.  
  8695. Lately I've been playing the game a lot with me controlling 1 wizard
  8696. against all the other computer wizards who are all on the same team against
  8697. me.  99 spells, unlimited turns, 6 artifacts and 6 scrolls, 4 artifacts,
  8698. Texas Trash'em, Computer Level 0, no classic, no impurities, no agent
  8699. casting.  I can almost always win.  I frequently win under 20 turns.
  8700. Maybe I was just having good luck?
  8701.  
  8702. So today I played as above but with only 5 artifacts and 5 scrolls.  I lost
  8703. 3 games in a row.  Once on turn 3.  Once on turn 8.  On my 4th game I was
  8704. FINALLY able to win on turn 73. For the last 15 turns of the game I was
  8705. getting dangerously low on spells.  It was a constant struggle to shoot
  8706. down walls with my bolters in order to keep getting a fresh supply of
  8707. spells rolling in.
  8708.  
  8709. In the beginning of the game they were blowing my creatures away left and
  8710. right.  I had no chance.  So I got in my castle and hid out while they
  8711. built this ridiculously HUGE army of mega-powerful super-duper-turbocharged
  8712. powered-up creatures.  I was going to DIE as soon as my castle collapsed
  8713. but then someone cast alliance on me.  HA HA.  So I spent a jillion turns not
  8714. really knowing what the hell I was going to do or how on earth I could win.
  8715. blah blah blah.  Turn after turn went by.  I had NO shooting creatures so I
  8716. couldn't "accidentally" shoot my allies.  To make it worse I didn't even
  8717. have any brain drains to go kill a wizard.  All I did was eventually cast
  8718. some wall spells to box in 2 of the wizards.  I used my creatures to box in
  8719. a 3rd one.  (I had only killed one wizard at the beginning of the game.)
  8720.  
  8721. To give you an idea of how powerful these guys were, they went around
  8722. mowing down all the generators, even though the dragon nests produced LOADS
  8723. of dragons for them to fight.
  8724.  
  8725. Then lo and behold, a wizard cast a bolter wall right into the middle of
  8726. the board and things started looking up for me!  I quickly cast subversion
  8727. on it, then recover boost, then double, then simulacrum then cloak then
  8728. replicate.  One of my allies was even nice enough to cast Range Boost on
  8729. one of my newly acquired Bolter Walls. hehe.
  8730.  
  8731. With my new army of 5 bolter walls I was ready to whoop some ass but I was
  8732. surrounded by jillions of trees, gooey blobs, dragons, undead creatures and
  8733. you name it.  The board was about 90% full.  So it took me FOREVER to be
  8734. able to kill an enemy wizard.  Then 2 forevers to kill the next one.
  8735.  
  8736. I got so many bonus spells that by the end of the game my wizard was so
  8737. powerful that he could cast ANYTHING ANYWHERE he wanted.  I was casting
  8738. Grizzly Bears halfway around the board. hehehe.
  8739.  
  8740. My score was 3031 which was 7x higher than anyone elses.  But the whole
  8741. opposing team combined had well over 2000.
  8742. --------------------------------------------------------------------------
  8743.  
  8744. * BUG: I vanished wizard 6 and then there was an enforcer hit on his turn!
  8745.   This only happened on the turn IMMEDIATELY after I cast vanish on him.
  8746.   It never happened again after that.  Ok, this was a problem with the game
  8747.   trying to move a wizard who had been warped.  I have now fixed MoveWizard()
  8748.   to check the .warped bit and exit if it is set.  NOW FIXED.
  8749.  
  8750. * MODIFIED isStupidCast to prevent casting of Speed and Fly on Bolter Walls. 
  8751.  
  8752. * NEW FLAG: FLAG_HIGHCR for the Archery and Nonarchery spells so that
  8753.   computer wizards will use them more intelligently.
  8754.  
  8755. * BUG: There is something wrong in the movement routine!  The Exorcist can't
  8756.   move! It says "Cannot attack the living" when trying to move into an empty
  8757.   space!  There are no other creatures nearby.  Happened on turn 1.
  8758.   The problem was in isInvalidAttack() NOW FIXED.
  8759.  
  8760. * BUG: uhmmm.. I've killed every single thing on the board and the game
  8761.   isn't ending.  This was caused by GetMass() not returning the correct
  8762.   number.  NOW FIXED.
  8763.  
  8764. * BUG: uhmmm.. I've killed every single thing on the board and the game
  8765.   isn't ending.  This was caused by LoadLevel() not setting the "Level"
  8766.   variable correctly (it was some totally weird number when it should have
  8767.   been 0).  NOW FIXED.
  8768.  
  8769. BUG: Enforcer hits on score screen at end of game.  I encountered this once
  8770. and then I was never able to duplicate it.  So I have no idea how it
  8771. happened. ???
  8772.  
  8773. * PROBLEM WITH VICTORY CONDITIONS: When playing the game with the default
  8774.   settings of 4 generators you sometimes win on the first turn without even
  8775.   doing anything! (when the generators don't generate anything on turn 1).
  8776.   So I changed it so that to win the game you must now either kill or block
  8777.   all independent generators.  NOW FIXED.
  8778.  
  8779. * PROBLEM: When I select "Save as" I like to save the game with the turn
  8780.   number as part of the filename.  But then I have to go back and check the
  8781.   score panel, then do save as again which is annoying.  So now I display
  8782.   the turn on the "Save as" panel and the "About" panel too. NOW FIXED.
  8783.  
  8784. * When the game ends it now tells you WHY it is ending.
  8785.  
  8786. ENFORCER HIT: I shot and killed my own wizard with my Blue Dragon and then
  8787. when I ended my turn it caused an enforcer hit.  Leaving this for SAI.
  8788.  
  8789. * UPLOADED v2.5d DEMO version to aminet on Sunday, June 27th, 1999.
  8790.  
  8791. *************************************************************************
  8792.                         BEGIN MUSIC UPGRADE
  8793. *************************************************************************
  8794. June 27th, 1999:
  8795. The dir Chaos_2.5/ has the FINAL 1 MEG VERSION in it.
  8796. The dir Chaos_2.6/ has the version with the new music in it.
  8797.  
  8798. * MUSIC is now played during spell-selection phase.  I played a couple of
  8799.   test games with 6 theme songs installed and it was MUCH better than 0 theme
  8800.   songs like we've had in the past but it still wasn't nearly enough.
  8801.  
  8802. * The game feels MUCH more upbeat with the new music!!!!
  8803.  
  8804. * BUG: When starting a new game the colors on the HiRes part of the setup
  8805.   screen are all wrong and it is positioned wrong too.  FIXED.
  8806.  
  8807. * BUG: When starting a new game the colors on the HiRes part of the
  8808.   gameboard are wrong. FIXED.
  8809.  
  8810. * BUG: Several of the new Sidewinder protracker mods won't work with the
  8811.   playroutine. They are playing EXTREMELY slowly.  I converted them to
  8812.   MED MMD1 so this is NOW FIXED.
  8813.  
  8814. * MODIFIED the game so that if you turn off sound and speech then the music
  8815.   plays continuously through the spell-selection, spell-casting and movement
  8816.   phases of the game, only changing at the beginning of the next turn.
  8817.  
  8818. * INCLUDED CD advertisement for Sidewinder CDs into the docs.
  8819.  
  8820. *** Color My World Modifications ***********************
  8821. * Shortened the intro.
  8822.  
  8823. should be at 52: c-3  a#2  b-2
  8824.  
  8825. Sequences with main tune:
  8826. 12,13,14,15,16, 17, 18, 19, 20, 45, 46, 47, 48,  51, 52, 71, 72, 75, 76, 
  8827. 11,09,09,12,10, 13, 14, 15, 16,
  8828.  
  8829. 12 has a bleep that I might remove.
  8830. 13 has breaking drumbeat I might remove. Nah leave it alone.
  8831.  
  8832.  
  8833. * BAD NOTE: 02 had a bad sounding note so I copied the block to 65 and
  8834.   fixed it.  block 02 is no longer used.
  8835.  
  8836. block 11 has extra stuff in it that interferes.
  8837. Block 11 is just like block 36 except for track 3 which is totally
  8838. different.
  8839.  
  8840. * I didn't like the way block 11 sounded, the notes from 2 different tracks
  8841.   were colliding with each other so I copied 11 to 64 and then wiped out
  8842.   track 2.  Block 11 is no longer used.
  8843.  
  8844. * NEW BLOCK:
  8845.   I was absolutely certain about all the changes I made so far but for this
  8846.   next one I'm not at all sure.  I made a new pattern 66 and couldn't decide
  8847.   where to put it or if it should even be in the song?  How do you decide the
  8848.   order or your blocks?  Do you use some sort of formula?  Or do you just
  8849.   throw them in there randomly?  I've always wondered about this.
  8850.   I put it near the end.
  8851. ***************************************************************************
  8852.  
  8853.  
  8854.  
  8855. * BUG: sometimes wizards cast Plasma Beam for some strange reason.
  8856.   then they always cast it up to the left, even if nothing is there, or even
  8857.   if it attacks multiple creatures that they own while not hurting any
  8858.   enemies.  Leaving this for SAI to investigate.  Fixed by JC months later on
  8859.   October 20th, 1999. NOW FIXED.
  8860.  
  8861.  
  8862. * BUG in protracker play routine.  There is a bug in the playroutine that
  8863.   causes certain protracker mods to play back incorrectly.  It sounds like
  8864.   the notes are being played back about 100x too slowly.  I have no idea how
  8865.   to debug this so I'm just converting the affected mods to MED format.
  8866.   Converted LOTS of protracker mods to MED MMD1 format.
  8867.  
  8868. * NEEDED: Dear SAI, could you please adjust the loading and saving such that
  8869.   player 3 can save the game, and then when reloading the game it will reload
  8870.   to player 3's spell selection phase?  Thanks.  Implemented by JC in August
  8871.   1999.
  8872.  
  8873. I am currently under death threats from Brian Dixon and my car has been
  8874. vandalized twice so I am under duress and I must now move.
  8875.  
  8876. ReleaseSemaphore(&SourceCode) by JC on July 3, 1999.
  8877. ObtainSemaphore(&SourceCode) by SAI on 5 July, 1999.
  8878.  
  8879. * OBSOLETED: EditPopupIDCMP is now handled my the main HandleIDCMP routine.
  8880.   This means that "q" querying etc. now works properly in the editor.
  8881.  
  8882. * Temporarily turned off the end of turn confirmation as I find it annoying.
  8883. * The menumode variable is now local to HandleIDCMP.
  8884. * Improved the implementation of the popup creature menus using an array
  8885.   of functions.
  8886. * Tidied up documentation in editor.c.
  8887.  
  8888. * Fixed a bug in ClearBoard().
  8889. * Fixed an incorrectly line relating to the CatLord in cast.c.
  8890. * Examined the remaining occurrence of ImpID occurring in the source.
  8891.   I was able to replace most of them with isIDcreature type constructs.
  8892.   The following occurrences remain:
  8893.    -- in the enumeration in defines.h (pretty obviously needed)
  8894.    -- in io.c (1 occurrence) in probability saving block
  8895.         [[ actually this code looks broken because it is only saving
  8896.            spell probabilities for creatures ]]
  8897.    -- in reincalc.c (1 occurrence). Since this is not compiled into the
  8898.       final game, I'm happy to leave this one alone and avoid having
  8899.       to include extra files.
  8900.  
  8901.    I eliminated all occurrences from spell.c, but because of how the
  8902.    loops work this file (among others) still depends on all creatures
  8903.    coming before other spells!
  8904.    Note from JC: it will be like that for a long time to come because I
  8905.                  won't have time to fix it for a very long time.
  8906.  
  8907.  
  8908. ReleaseSemaphore(&SourceCode) by SAI on 19-August-1999
  8909. ObtainSemaphore(&SourceCode) by JC on August 19th, 1999
  8910.  
  8911. * End Turn Confirmation is now an option in the menus. Default is OFF.
  8912.  
  8913. * PROBLEM: The "about" screen with the pentagrams hashes sometimes.  It
  8914.   hashes a lot and looks utterly terrible under heavy CPU load.  NOW FIXED
  8915.   by increasing the taskpri to 100 during the doublebuffer switching.
  8916.  
  8917. * PROBLEM: The credits scrolling is not 100% smooth and is very jerky
  8918.   under heavy CPU load.  NOW FIXED by increasing taskpri to 100 during
  8919.   the doublebuffer switching.
  8920.  
  8921. ***************************************************************************
  8922. * NEGATIVE SCORE BUG:  I played a game against JJ and I won but my score
  8923.   was negative and his was positive so he claimed he was really the winner.
  8924.   In the current version of the game shooting the following scrolls gives
  8925.   the following points:
  8926.  
  8927. Scrolls of creatures award as many points as the original life of the real
  8928. creature.
  8929.  
  8930. moveit -124
  8931. Pox shield -125
  8932. acid rain -123
  8933. devastation -1
  8934. touch of god -116
  8935. ball lightning -114
  8936. plasma beam -113
  8937. sword of sassenrath -118
  8938. cursed sword -110
  8939. nomount -86
  8940.  
  8941.   Other scrolls have various (mostly HUGE) positive scores associated with
  8942.   them.  This is all caused by bad subscript errors.  Points are awarded
  8943.   according to the .Life statistic. But Magic Spells don't have a
  8944.   .Life statistic so it just accesses some other data.
  8945.  
  8946. Simply replace all occurrences of ScoreAdd(player,InitialData[id].life)
  8947. with IF IsScroll(cellp) THEN
  8948.         ScoreAdd(player,1)
  8949.      ELSE
  8950.         same line as before
  8951.      END_IF
  8952.  
  8953. Made required changes to DevastationHandler() also.
  8954.  
  8955. DONE AND FIXED.
  8956. *****************************************************************************
  8957.  
  8958. * Above fix increased the filesize of cast.o just enough to start producing
  8959.   Error 502: Reference to function > 32768.  So I had to change the
  8960.   makefile for cast.c to use code=far.  NOW FIXED.
  8961.  
  8962. * BUG: DeathBringer struck a scroll dead.  NOW FIXED.
  8963.  
  8964. * PROBLEM: We keep getting Emails from NTSC users who don't know how to
  8965.   PALboot their Amiga.  I added in the AmigaToPAL cli command which
  8966.   requires OS 2.04 or higher. Now the game automatically puts the computer
  8967.   into pal mode. FIXED.
  8968.  
  8969. * BUG: Pressing 'q' on the creatures on the alt-o menu thing shows the
  8970.   spell description instead of their stats.  NOW FIXED.
  8971.  
  8972. * PROBLEM: I was implementing Spell-List editing so I made a new file
  8973.   "SpellListedmenu.dat" and I adjusted the makefile to run menumaker on it
  8974.   just like edmenu.dat.  But this produces 2 different files, each with their
  8975.   proper menu data, but each uses the exact same same variable names!
  8976.  
  8977.   I have worked around this by hand-editing SpellListedmenu.c so that all
  8978.   variables start with "sl".
  8979.  
  8980.   Is there a more general way that you want to work around this?
  8981.  
  8982.  
  8983. ****************************************************************************
  8984. *****                 Spell-List Editor Upgrade                        *****
  8985. ****************************************************************************
  8986.  
  8987. Since SAI has become burned out on coding and the game is suffering from a
  8988. lack of attention I have hatched an ingenious plan! }8)
  8989.  
  8990. I have decided to implement a Spell-List editor for Chaos this way
  8991. (hopefully) I can get SAI to design some levels for me to have fun playing.
  8992.  
  8993. This will allow us to maintain development momentum.
  8994.  
  8995. These days I have very limited time to spend working on the game and this
  8996. was the simplest coding upgrade I could think of.  It took me my entire 2
  8997. days off + 1 work day to implement it.  This doesn't bode well for my other
  8998. upgrade plans. 8(
  8999.  
  9000. Now that we have spell-list editing we can start making REAL levels for
  9001. Chaos!  YAY!!!   Now when I come home from work and I'm too tired to
  9002. program, maybe I'll have enough energy to do some level designing.
  9003.  
  9004.  
  9005.  
  9006. Implement Spell-list editing ROUGH NOTES:
  9007. * 0. Have a seperate spell-list editor which is different from the "board
  9008.      editor"
  9009. * 1. Its easy.  Just make a SpellBoard for storing the spell list onto.
  9010.      DONE.
  9011. * 2. You select "Edit Spell List" from the Main Menu.  DONE.
  9012. * 3. Figure out where the code goes when you select "Edit Spell List" ???
  9013.      DONE.
  9014. * 4. delete copy and paste work exactly the same as in the board-editor.
  9015.      DONE.
  9016. * 5. Modify HandleIDCMP + make new menu.  DONE.
  9017. * 6. Need CopySpellsFromListToBoard(player)
  9018.      (do this once at the beginning + anytime the player number is changed) DONE.
  9019. * 7. Need CopySpellsFromBoardToList(player)
  9020.      (do this whenever you select "quit" or change player number) DONE.
  9021. * 8. Need alt-i for "insert" an empty space into the spell-list. DONE.
  9022. * 9. Need alt-d to delete just as in the board editor unless it is used
  9023.      on an empty cell in which case the empty cell is deleted and all cells
  9024.      to the right are scooted 1 space to the left. DONE.
  9025.  
  9026. Anytime you select a player number the SpellBoard is cleared and rebuilt
  9027. with the selected player's spell list.
  9028.  
  9029. then by pressing alt-o it switches to the backup board and displays all the
  9030. available spells just like in the board editor.
  9031.  
  9032. alt-o MUST switch from board to backupboard and then back to board!
  9033. Don't switch back to realboard!!!!  Because sometimes board will be
  9034. realboard and sometimes it will be spellboard.
  9035.  
  9036. Choose a spell, switch back to the SpellBoard, and place it in the spell list.
  9037.  
  9038. Only the first 150 positions are used.  You should normally only use the
  9039. first 99.
  9040.  
  9041. Upon exiting the first 150 positions on the SpellBoard are copied into the
  9042. real spell list of the player.
  9043.  
  9044. When you place a spell it goes "on top of" the one that is already there.
  9045. Thus you can immediately delete a just-placed spell and the old spell will
  9046. be there.  A miniature undo feature.
  9047.  
  9048.  
  9049. August 26th, 1999
  9050. Ok, now the Spell-List editor works great but...  I still haven't
  9051. worked out how to fix the gamesave format to save on a particular person's
  9052. turn! 8(   I shouldn't start designing any levels till I figure that out
  9053. and modify the gamesave format accordingly.
  9054.  
  9055. ******************************************************************************
  9056. *****                END of Spell-List Editor Upgrade                    *****
  9057. ******************************************************************************
  9058.  
  9059. ******************************************************************************
  9060. *****                    Gamesave Format Upgrade                         *****
  9061. ******************************************************************************
  9062.  
  9063. * currentPlayer is now saved.
  9064. * BUG: ExorcistID is listed in the translation table twice!       FIXED.
  9065. * BUG: Probability information was not completely saved.          FIXED.
  9066. * BUG: the currentSpell was being saved but not translated.       FIXED.
  9067. * BUG: When you save the game it resets back to player 1's turn.  FIXED.
  9068. * BUG: When you load a game it resets back to player 1's turn.    FIXED.
  9069.  
  9070. * REMOVED old stuff that is no longer needed.
  9071.  
  9072. August 31st, 1999
  9073. OK, now gamesaving works perfectly!  You can save on anyone's turn and
  9074. upon reloading it reloads back to that player's turn.
  9075.  
  9076. * BUG: The FavoriteFoodID and RunsAwayFromID is not translated like all the
  9077.   other ids.  So the first time we add a new spell to the game, all our
  9078.   previously designed levels will have creatures with messed up tastes and
  9079.   fears.  NOW FIXED.
  9080.  
  9081. * ADDED: Lots of extra BYTES, WORDS and ULONGS to the header block for
  9082.   future expansion.  This way I hopefully won't need to convert levels from
  9083.   old format -> new format everytime I add a new option to the game.
  9084. * ADDED: Lots of extra BYTES, WORDS and ULONGS to the cell structure for
  9085.   future expansion.
  9086. * ADDED: Lots of extra BYTES, WORDS and ULONGS to the char_stat structure
  9087.   for future expansion.
  9088.  
  9089. * HOPEFULLY I can now do a complete major upgrade or 2 or 3 and not have to
  9090.   convert all the old levels up to the new format.
  9091.  
  9092. ******************************************************************************
  9093. *****                 END of Gamesave Format Upgrade                     *****
  9094. ******************************************************************************
  9095.  
  9096. ******************************************************************************
  9097. *****                     Line of Sight Upgrade                          *****
  9098. ******************************************************************************
  9099.  
  9100. * BUG: If you are trying to cast a roper or bolter wall etc. along a 45°
  9101.   angle, the "l" key will show that you have line of sight but sometimes the
  9102.   "c" key says you don't!  And when the "c" says you can't cast it there you
  9103.   really can't cast it there even though it is in range and you have line of
  9104.   sight!  This is caused by a problem in isLineOfSight.  isLineOfSight
  9105.   _SHOULD_ work perfectly but it doesn't.  I don't know why. Its like it is
  9106.   off by 1 or something.  This problem only occurs when there are generators
  9107.   adjacent to the 45° path.  If you want to investigate this mystery then
  9108.   please do so.  In the meantime I have solved the problem by replacing all
  9109.   occurrences of isLineOfSight C code with isLineOfSightQ asm code. NOW FIXED.
  9110.  
  9111. * SPEEDUP: Computer controlled shooters now decide who they will shoot over
  9112.   2x as fast as before!
  9113. * SPEEDUP: Computer AI is now MUCH faster than before!
  9114. * SPEEDUP: "c" key is now over 3x as fast as before!
  9115. * SPEEDUP: "s" key is now much faster!
  9116.  
  9117. * BUG: isLineOfSightQ does not automatically return TRUE when the source
  9118.   cell is the destination cell.  (This prevented me from casting Combat on
  9119.   myself)  NOW FIXED.
  9120.  
  9121. ******************************************************************************
  9122. *****                   END Line of Sight Upgrade                        *****
  9123. ******************************************************************************
  9124.  
  9125. * FIXED various bugs with the Mass Ressurrect spell + pox or reincarnation
  9126.   or vanquished foes.  It was all very broken.  NOW FIXED.
  9127.  
  9128. *************************************************************************
  9129. ** Remove Owner from the animation byte and transfer it to its own byte**
  9130. *************************************************************************
  9131.  
  9132. Methodically go through and replace all >> 3 occurences with a
  9133. GetPlayer() call.  Replace all occurrences of << 3 with a 
  9134. ChangeOwner(cell) subroutine that does everything needed to change the
  9135. owner of a cell to another person.
  9136.  
  9137. * All occurrences of PLAYER_MASK, << 3 and >> 3 have been REMOVED from all
  9138.   spell files.
  9139. * All occurrences of >> 3 have been REMOVED from chaos.c, info.c, move.c
  9140.   and predicate.c
  9141. * All but 1 occurrence of >> 3 REMOVED from core.c (it refers to oldflag).
  9142. * All but 1 occurrence of >> 3 REMOVED from editor.c (it refers to buffercell).
  9143. * All occurrences of << 3 have been REMOVED from chaos.c and init.c
  9144. * Did not replace any occurrences of << 3 in core.c as all the uses seemed
  9145.   to be very lowlevel.
  9146.  
  9147. * Backed up the Chaos_2.61 dir to Chaos_2.62.  Work will proceed in
  9148.   Chaos_2.62 dir.
  9149.  
  9150. * Redid the cell structure so that there are .owner and .oldowner bytes
  9151.  
  9152. * All remaining occurrences of << 3 and >> 3 REMOVED!
  9153.  
  9154. * Anywhere there is a reference to .oldflag will be added a reference to
  9155.   .oldowner.  DONE.
  9156. * Check all references of .flag and if refering to player number then replace
  9157.   them with .owner.  DONE.
  9158. * Went back and looked at EVERY usage of .flag, ->flag, .oldflag and
  9159.   ->oldflag and looked for anything susupicious and fixed it.
  9160.  
  9161. * Eliminated 40 occurrences of code like "& PLAYER_MASK >> 3" and
  9162.   "|= Player << 3" Thus saving at least 360 bytes of code.
  9163.  
  9164. * WizardInfo structure now has a .owner byte also.  Modified BackupWizard()
  9165.   and RestoreCellWizard() and io.c appropriately.
  9166.  
  9167. * ALL files 100% cleaned up!
  9168.  
  9169. * Played a test game.  Saved and Loaded multiple times.  Everything works.
  9170. * Sending to SAI on September 9, 1999.
  9171.  
  9172. *****************************************************************************
  9173. ** END Remove Owner from the animation byte and transfer it to its own byte**
  9174. *****************************************************************************
  9175.  
  9176. * NEW FUNCTION: CenterWriteText
  9177.  
  9178. * REGISTERED USER on September 17th: a nice chap from Ireland mailed in his
  9179.   registration fee. He has an AGA Amiga 1200 tower with Zorro IV Busboard,
  9180.   Picasso IV gfx card, 50 Mhz 060, 64 Megs of RAM, Power Flyer, etc.
  9181.  
  9182. * Added Sidewinder to the Scrolling Credits.
  9183. * Played Sean's Levels 1-4 and 10.  Added turns_left to the about screen.
  9184. * Added Registered_Text to hold the registered user's name.
  9185.  
  9186. ******************************************************************************
  9187. *****                   Exploration Mode Upgrade                         *****
  9188. ******************************************************************************
  9189.  
  9190. I was originally not going to implement exploration mode until the graphics
  9191. upgrade programming was done.  But since I have extremely limited time
  9192. these days I've re-ordered my priorities to do this upgrade first since it
  9193. seems nice and easy and provides the MAXIMUM improvement in gameplay.
  9194.  
  9195. When exploration mode is on you cannot see cells which you have not
  9196. explored.  Once you have explored a cell it stays permanently explored,
  9197. there is no need to maintain line-of-sight to the cell.  This makes the
  9198. gameplay nice and simple, the way I like it.
  9199.  
  9200. Most creatures simply explore the cell they are in and all adjacent cells.
  9201.  
  9202. Some creatures, like Eagles explore further and can see behind walls due to
  9203. flying high in the air.
  9204.  
  9205. Other creatures, like snakes, can "feel" the movements of other creatures at
  9206. far distances, thus allowing them to map cells which are hidden behind
  9207. walls that cannot be seen by normal creatures.
  9208.  
  9209. Certain other creatures can hear or smell other creatures.
  9210.  
  9211. This adds the "Explore-the-Map" play mechanic to the game.  You can't see
  9212. any cells until you have sent a unit to map them.  Once mapped the cell
  9213. remains visible forever even if you have no nearby units or no
  9214. line-of-sight.
  9215.  
  9216. You can also see the cells that your allies can see.  But if they stop
  9217. being your ally then you can no longer see those cells.
  9218.  
  9219. I love games where you must explore the level and map it out.
  9220.  
  9221. Having Exploration Mode turned ON makes the game MUCH harder since you
  9222. have no idea what direction you should be going in the early stages of the
  9223. game.  Nor do you have any idea what direction you will be attacked from
  9224. at first.
  9225.  
  9226. Exploration mode makes computer movement more CPU-intensive which is
  9227. why I waited so long to implement it.  Now that the game is aimed at a 2
  9228. meg 020+ amiga it shouldn't be a problem.
  9229.  
  9230. Exploration mode doubles the amount of fun generated by the game IMHO.
  9231.  
  9232. I was going to wait and implement Exploration after I did the graphics
  9233. upgrade but due to my extremely limited time I had to reprioritize things
  9234. and am now implementing the simplest upgrades first.
  9235.  
  9236.  
  9237. Rough Notes:
  9238. I added ExploreCell(cell) line of code to the following routines:
  9239. RestoreCell
  9240. RestoreCellWizard
  9241. InsertCreature
  9242. WarpIn
  9243. Growth
  9244. the teleport spell
  9245. MoveTempest
  9246. MoveVortex
  9247. CrMove1
  9248. cMoveEngaged
  9249. cMoveNonEngaged
  9250. CalculateArtifactOwners
  9251. WakeUp (used by Subversion, Betrayal and Wake)
  9252.  
  9253. * REWROTE Charm, Raise Dead, Mass Ressurrect and Swap spells to use
  9254.   ChangeOwner()/changeOwner() or InsertCreature
  9255.  
  9256. Hopefully that is all the places that needed it.  Can you think of any
  9257. routines that magically cause a creature to appear somewhere that don't
  9258. use the above routines?  If so they probably need ExploreCell(); added 
  9259. somewhere.
  9260.  
  9261. * 0. Modify io.c to handle loading/saving all the new stats. ALREADY DONE.
  9262. * 1. Convert spellman.tex into a real JC file since I will be editing sm.c.
  9263.      DONE.
  9264. * 2. You MUST have a real cellnumber for the ExploreCell() routine!!!!
  9265.      Because you hafta do sqDistance from the cell numbers! DONE.
  9266. * 3. Write the real exploration routine. DONE.
  9267.      MUST TAKE INTO ACCOUNT CanBeSeen or CantBeSeen!!!!! DONE.
  9268.      Change CanBeSeen into CantBeSeen etc.  DONE.
  9269.      Take into account sleeping, dead, scrolls and nobody artifacts. DONE.
  9270. * 4. Adjust AutoMouse Routine.  DONE.
  9271. * 5. Adjust information panels.  DONE.
  9272. * 6. Adjust ReDrawCell.  DONE.
  9273. * 7. Adjust animator task.  DONE.
  9274. * 8. Make ChangePlayerView Routine.  DONE.
  9275. * 9. Modify sm.c to handle all the new stats. DONE.
  9276. *10. Add the stats into the spell files.  (Only nonstandard creatures need the
  9277.      stats added in.  Others use the built-in defaults.)  DONE.
  9278.      I made all snakes feel out 6 squares.
  9279.      Snakes cannot be felt, smelled or heard.  Only seen.
  9280.      All living flying creatures don't need LOS to see.  And most see out 2
  9281.      squares.
  9282.      Eagle, Falcon and Vulture have Excellent eyesight.
  9283.      Spectator, Achiyalabopa and Harpy have poor eyesight.
  9284.      Vulture, Dire Wolf and Arctic Wolf have excellent sense of smell.
  9285.      I couldn't really decide what to do about other creature's senses.
  9286.  
  9287. I keep saying eyesight but maybe I should really change it to
  9288. "cartography"?
  9289.  
  9290. Still need to consider flying undeads.
  9291.  
  9292. Still need to consider some ground creatures which can see out 2 squares
  9293. and requireLOS.
  9294.  
  9295. Perhaps archers and ogre mages could have excellent eyesight?
  9296.  
  9297.  
  9298. Useful table of sqRanges:
  9299.  
  9300. 1 = just the 4 adjacent cells.
  9301. 2 = all 8 adjacent cells.  (out 1 diagonally)
  9302. 4 =                  (2 horizontally)
  9303. 8 = all 16 adjacent cells. (out 2 diagonally, 2 horizontally)
  9304. 9 =                  (3 horizontally)
  9305. 18= out 3 diagonally (4 horizontally)
  9306. 32= out 4 diagonally (5 horizontally)
  9307. 36=                  (6 horizontally)
  9308. 50= out 5 diagonally (7 horizontally)
  9309. 72= out 6 diagonally (8 horizontally)
  9310. 98= out 7 diagonally (9 horizontally)
  9311.  
  9312.  
  9313.  
  9314. ****  OOPS!  Now I remember why I was supposed to wait until the graphics
  9315. upgrade was complete before I implemented all this stuff!  All those cloak
  9316. images drawn on the board for player 1's view are blocking LOS for
  9317. everybody!  If I had done the graphics upgrade first this would not be any
  9318. problem at all.  Drat. ****
  9319.  
  9320. *11 solve the problem of all those cloaked cells blocking los for the
  9321.     computer players while player 1 is watching the action!
  9322.     A. Calculate AutoFailArray.  Easy.  If it isn't explored then its
  9323.        autofail else its not.  DONE.
  9324.     B. When you explore a cell you 0 out that element of AutoFailArray +
  9325.        you recalc the AutoAcceptArray for that cell.  DONE.
  9326.     C. Modify JC LOS routine to take into account AutoFail. DONE.
  9327.     D. Make the AutoFail() function just like AutoAccept() Function. DONE.
  9328.     E. Make the AutoFailArray[] just like AutoAcceptArray. DONE.
  9329.     F. Make the CalculateAutoAcceptAndFail FUNCTION.  DONE.
  9330.     G. Modify asm code to use AutoFailArray. DONE.
  9331.     H. OOPS.  Above mods didn't work due to lack of registers so I'm
  9332.        ELMINATING the AutoFailArray[] and using AutoAcceptArray[x] == -1
  9333.        to mean that it is an AutoFail cell.  This saves a register in the asm
  9334.        code and it also saves 1 instruction in the main loop.
  9335.        This new way is super efficient. DONE.
  9336.  
  9337. Normally I would simply have the "board" displayed to the screen using
  9338. cloaked cells for unexplored cells.  And all LOS calculations take place on
  9339. the shadow board which has the shadow masks of every cell  there all the
  9340. time no matter what.  + unexplored == autofail.  Everything would work
  9341. perfectly and effortlessly and quickly.
  9342.  
  9343. Ok but i don't have the shadowboard yet because I haven't done the gfx
  9344. upgrade yet so I will just hack in a secret rastport which has the images
  9345. of everything for los calculations.
  9346.  
  9347. So redrawcell and animator will simply draw 2 images, one to the display
  9348. based on playerview, and 1 to the shadowboard which is the real image.
  9349. LATER ON it will draw 2 "images" but the 6 bitplane images only go to the
  9350. screen and the shadowboard only gets a 1 bitplane image. (The ShadowMask
  9351. which will all be done automatically by my asm cellrendering routines which
  9352. I coded like 2 years ago!
  9353.  
  9354. Damn this whole double rastport method  will be slow and lame and waste
  9355. TONS of chipmem!!!
  9356.  
  9357. I need to do the gfx upgrade so I can do the REAL shadowboard!!!!
  9358. This hacked-in method is messing up the sound effects! (Really this is a
  9359. problem with the sound effects system being dependent on cpu speed.)
  9360.  
  9361.     I. Create ShadowBoardMem, ShadowBoardBitMap and ShadowBoardRastPort
  9362.        along with initialization and cleanup code.  DONE.
  9363.  
  9364. September 21st, 1999.  My evil mom broke my $550.00 Commodore 1950
  9365. Multisync monitor!  ARRGGHHH!!!  I had to switch back to my $50.00
  9366. Commodore 1084S.  ack.  Now I hafta use 640x256 resolution!  I'm back in
  9367. the stone ages!  I'm going to die of lameness!
  9368.  
  9369.     J. Modify ReDrawCell and Animator Task. DONE.
  9370.     K. Modify LOS routine to use the ShadowBoardRastPort when
  9371.        ExplorationMode == YES
  9372.        This requires creating a new LOSBitPlane variable which normally
  9373.        will = LoResBitPlane but when ExporlationMode==YES
  9374.        LOSBitPlane will = the first byte of the first bitplane of the ShadowBoard.
  9375.        Setup and Asm Code properly modified. DONE.
  9376.  
  9377. * TESTED OK September 22, 1999:  Ok at this point I have never actually
  9378.   tested any of the above modifications A-K.  So I just set PlayerView==1
  9379.   and ran the game to test out the above changes.  EVERYTHING WORKS PERFECTLY!
  9380.   Its totally amazing!  Geez I must be a 40th level megacoder!  I can explore
  9381.   the map and I can't see the enemies, its totally kewl!
  9382.   Well my Vulture (which can see 3 cells) and my Pegasus (which can see 2
  9383.   cells) are totally mapping out the board super fast.  This has convinced me
  9384.   to reduce the sightranges of all flying creatures.
  9385.   Vulture and Eagle will see out 2 squares diagonally.  All other flying
  9386.   creatures will be set to see only 1 square out just like the ground
  9387.   creatures (except flying creatures don't need LOS so if their sightrange
  9388.   ever gets increased they'll be able to see over walls and things.) DONE.
  9389.  
  9390. * 12. Replace all occurrences of HighLightCell= with a call to the new
  9391.       HighLight() function which will check that the cell is visible to
  9392.       the current PlayerView before highlighting it.
  9393.       HighlightCell=-1 becomes HighLight(-1); etc.   ALL DONE.
  9394. * 13. Entering the board editor or spell editor should set ExplorationMode=NO
  9395.       and upon exiting it should be returned to its former status.  DONE.
  9396. * 14. Changing spell-selection phase, spell-casting phase or movement
  9397.       phase to a human player should do a ChangePlayerView();  DONE.
  9398. * 15. Cell effects which only affect 1 cell need to be modified so that if
  9399.       the cell is not visible to the current PlayerView then they are not
  9400.       drawn.  I don't know if they should still make the sound or not???
  9401.       I simply made CellEffect() do nothing (no gfx or sound) if it is
  9402.       taking place in an unexplored cell for now since that was the easiest
  9403.       way to do it.  DONE.
  9404. * 16. Make MaskWritePixel(); function for use by the graphical effects in
  9405.       ExplorationMode.  DONE. 
  9406. * 17. ThreeBeam has a flaw in that it sometimes writes pixels to negative
  9407.       coordinates.  The OS clips these and doesn't display them but still it
  9408.       shouldn't be trying to write pixels to -1,-2 coords.  NOW FIXED.
  9409. * 18. ThreeBeam needs to be modified so that the pixels which would have
  9410.       been plotted in unexplored areas are not.  Only pixels which plot into
  9411.       explored areas really get drawn.  Replace all WritePixel() calls with
  9412.       MaskWritePixel() which will return 1 if it wrote the pixel and 0 if it
  9413.       wrote nothing.  Add up the return values and if >0 then do the AUDIONote
  9414.       else don't. DONE.... Later on... I have now decided that I like
  9415.       hearing the sounds of what is going on in unexplored regions so I no
  9416.       longer mask the sound on this effect.  DONE.
  9417. * 19. Modify PlotBreath(), PlotBolt() and BirdShot() as above.  DONE.
  9418. * 20. Modify BoardEffect() to not do the effect on unexplored cells. DONE.
  9419. * 21. Modify Cycle() / Bow weapon.  This automatically fixes
  9420.       WeaponEffect() and WeaponEffectDrawer().  I intentionally
  9421.       left the sound effects in place and only hide the graphics.  DONE.
  9422. * 22. Lightning() will be left as it is because there is no easy way to mask
  9423.       it.  If you cast it you reveal your position.  DONE.
  9424. * 23. WizardExplode() will not be masked simply because I like to know when
  9425.       an enemy wizard has died, even if he dies in the vast expanse of the
  9426.       unexplored regions.  DONE.
  9427. * 24. New function: CompletelyRecalculateTeamExplore(); This function must
  9428.       be called any time the teams change for any reason.  DONE.
  9429. * 25. Alliance, Separation and core.c "death of wizard" code modified to
  9430.       use CompletelyRecalculateTeamExplore();  Tested and works great!  DONE.
  9431. * 26. Exiting the spell editor or board editor doesn't redraw the board right
  9432.       because REDRAWALL doesn't redraw all those empty explored spaces!
  9433.       So I changed ReDrawAll to redraw everything (even empty spaces)
  9434.       IF ExplorationMode==YES.  DONE.
  9435. * 27. At beginning of game set playerview  to 15 since that will show a solid
  9436.       grey board.  DONE.
  9437. * 28. September 29, 1999: The next problem requires a change to the gamesave
  9438.       format so I am starting a new version now.  Begin Version 2.6.3.
  9439.  
  9440. * 29. MAJOR PROBLEM WITH REPULSION: The Replusion spell copies cells around
  9441.       using board[x]=board[y] style code.  But this copies the exploration
  9442.       bits to so it ends up exploring areas that you've never been too and it
  9443.       looks buggy.
  9444.  
  9445.       Also the clone, hyperclone and warp spells use board[x]=board[y] code
  9446.       which means they are copying around the exploration bits of players that
  9447.       they are not supposed to!
  9448.  
  9449.       Also the movement routines and other places use board[x]=board[y] style
  9450.       of coding producing imperfect results for ExplorationMode.
  9451.  
  9452.       POSSIBLE SOLUTIONS:
  9453.       A. Make a new "CopyCell" routine which copies everything EXCEPT the
  9454.          exploration info.
  9455.       B. Take the exploration bits out of the cell structure and make them
  9456.          their own array.
  9457.  
  9458.       I have opted for Option B because it is the easiest and most logical
  9459.       way to code it.
  9460.       There is now an Exploration[] array and an ExplorationTeam[] array.
  9461.       I have removed them from the cell structure and modified the macros and
  9462.       exploration code appropriately.
  9463.       This neccessitates a new block of code for the gamesave/load routines.
  9464.       ALL DONE.
  9465. * 30. FLAW: I was playing a test game in ExplorationMode and I started out
  9466.       with Triple, Red Dragon, Replicate, Cloak.  So I had 6 red
  9467.       dragons, 3 of which were cloaked so I was trying to explore the map as
  9468.       fast as possible so I was flying each dragon deep into unexplored territory.
  9469.       I clicked on my cloaked dragon and moved him deep into an unexplored
  9470.       area and the game made a funny noise and my dragon was gone!  At
  9471.       first I didn't know what the hell had happened.  Then I realized
  9472.       that I had flown him into a pit.  Poor little dragon 8(
  9473.       NOW FIXED with informative text message.
  9474. * 31. A computer player cast Vengeance on wizard 1 while it was on wizard 2's
  9475.       view and it showed the spunge effect on the unexplored cell! Wrong.
  9476.       Its not supposed to do that!  Modified SpungeColour() to use
  9477.       MaskWritePixel()  NOW FIXED DONE
  9478.  
  9479. * 32. The Following spells need to be investigated/modified to call
  9480.       ExploreCell() in an appropriate manner: Repulsion, Replicate,
  9481.       Simulacrum, HyperClone, Teleport, The time when any creature warps back
  9482.       in to the board, Turmoil, Vortex, Tempest, Roper teleportation,
  9483.       GrowthRoutine, Horror, Passsage.  ALL DONE.
  9484.  
  9485. Please keep in mind that from this point on if you copy cells around you
  9486. must have a corresponding ExploreCell() call.  Furthermore if the
  9487. original cell is being erased then the ExploreCell() call must happen AFTER
  9488. the original cell is erased (for line-of-sight reasons).
  9489.  
  9490.  
  9491. Question: Should inanimate objects and growths explore cells just as well
  9492. as living creatures?  I am thinking that maybe we should set their
  9493. sqSightDistance down to 0 so they will only explore the cell that they are in
  9494. and no further.  What do you think I should do?  On the other hand leaving
  9495. things as they are means that casting Meteor Storm is actually usefull now
  9496. and it also can prompt human players to cast walls and trees around wildly
  9497. in an attempt to spot generators or dragons.  So I think I'll leave things
  9498. as they are.
  9499.  
  9500. At this point (September 30th, 1999) I have already played numerous test
  9501. games and everything has apparently worked ok but there is one fundamental
  9502. thing still to be done in order for creatures which have long-range sensory
  9503. perceptions which require Line-Of-Sight. (I don't think there are currently
  9504. any such creatures, but there will be one day.. or such creatures will be
  9505. manufactured through the use of magic spells).  This brings us to #33.
  9506.  
  9507. * 33. BUG: Any creature with e.g. sqSightRange of 32 and SightRequiresLOS==YES
  9508.       can't actually see that far because the close-up unexplored cells
  9509.       block LOS to the further away unexplored cells therefore:
  9510.       ExploreCell() must be modified to sort all the cells on the board
  9511.       into ascending order of distance from the observer. Then this sorted
  9512.       list of cells will be used instead of just going through the cells
  9513.       from 0 to 239.  NOW FIXED AND DONE.
  9514.  
  9515. PLAYED a test game with the sound off.  I controlled 2 wizards against 4
  9516. generators with Texas Trash'em OFF and no artifacts or scrolls.
  9517. ExplorationMode=ON.  Boy the game sure is harder when ExplorationMode is on
  9518. and Texas Trash'em is off!  I LOST THE GAME ON TURN 26.  I had been
  9519. fighting for my life in a hopeless battle for several turns.  I'm glad they
  9520. finally put me out of my misery. 
  9521.  
  9522. One interesting thing is that I cast my Meteor Storm on turn 3 and it
  9523. helped me map out the level quite nicely.
  9524.  
  9525. If I had played the game where both my wizards were in an alliance then I
  9526. think I could have won the game but I never had LOS for Wizard #2's
  9527. RangeBoost to be cast on Wizard #1's Elf.  That one problem ruined
  9528. everything for me.  If they had been in an alliance they would have had LOS
  9529. to cast powerups on each other. My score was 219+82.
  9530.  
  9531. * 34. Speed up the "derive Cell from pixel coords" code in MaskWritePixel by
  9532.       using my LSRCellHeightShiftBitMultGAMECOL[y] technique from cell.c. DONE
  9533. * 35. NEW MACRO CellFromPixel(x,y)  using maximum speed technique.  DONE.
  9534.  
  9535. * 36. ChangeExplorationMode() routine.  DONE.
  9536.  
  9537. * 37. Modify all Numeric keypresses to check that the cell is really visible
  9538.       to the current PlayerView before highlighting it.
  9539.  
  9540. PROBLEM: when you press the "c" key over a spell which "works over the
  9541. entire world and does not require line of sight" on the first turn of the
  9542. game, you can sort of cheat and see the positions of enemy wizards.
  9543. This applies to Armour, Cursed Sword, Dark Power, Vengeance, etc.
  9544.  
  9545. What should we do about this?
  9546. A. Leave it as is.  (and this will explain why computer players use such
  9547.    spells on creatures they can't "see")
  9548. B. Change the "c" key to only highlight explored cells, even though the
  9549.    cast is legal.
  9550. C. Simply add a new CAST_NOTONUNEXPLORED or CAST_EXPLOREDONLY bit to certain
  9551.    spells such as Vengeance, Dark Power, Justice, Armour, Cursed Sword, etc.
  9552.    Probably every spell which doesn't need Line-of-Sight would need
  9553.    CAST_NOTONUNEXPLORED.  Also add "Cannot cast on unexplored cell" to the
  9554.    2nd info panel of the spell information thing.
  9555.  
  9556. I have chosen option C and have modifed EVERY SPELL which does not need LOS
  9557. except for the following exceptions:
  9558. I Intentionally did not add CAST_NOTONUNEXPLORED to the Bury, Magic Glass,
  9559. Iridium, MassMorph, Mutate, NoGrow, Pit, TheExorcist, Singular Earthbind,
  9560. Spectator, Teleport, Thundermare, Vodka and Weak Wall.  If there are any
  9561. complaints about this then I can add it in to these spells too.  I'm not
  9562. too sure about all this.  Only time will tell.
  9563.  
  9564.    Should I also add CAST_UNEXPLOREDONLY for the proposed mapping spell
  9565.    that lets you map out a bunch of cells?
  9566.  
  9567. * PROBLEM: Pressing the 'l' key on a blank cell only highlights  that cell
  9568.   and the 8 adjacent cells because the owner of that cell (NOBODY) has not
  9569.   explored any cells.  I put some special code in AutoFail() so now the 'l'
  9570.   key works like it always did.  NOW FIXED.
  9571.  
  9572. * BUG: Moving a creature into an unexplored cell causes him to not be
  9573.   highlighted anymore, even though he still gets to shoot.  The problem is
  9574.   that the destinationcell is being highlighted before it has been explored,
  9575.   thus the highlighting is not shown.  NOW FIXED.
  9576.  
  9577. * 38. Added CAST_NOTONUNEXPLORED to the spellinfo screen.  DONE.
  9578.  
  9579. * 39. Added SightRange, FeelRange, SmellRange and HearRange to creature
  9580.       info panel 2nd screen.  DONE.
  9581.  
  9582. * 40. Changed the Ghost and Drelb so they can't be felt or smelled.  DONE.
  9583.  
  9584. * 4 NEW SPELLS: Cartography, Alternography, Seismology, Telescope.
  9585.   Alternography majorly kicks ass!
  9586.  
  9587. * After adding the new spells I loaded up the old levels to see if they
  9588.   still worked and ... THEY DO! 8)
  9589.  
  9590. * BUG: Highlight() routine is highlighting the computer wizard's creatures
  9591.   even though they are in areas which are unexplored by me.  NOW FIXED.
  9592.  
  9593. ******************************************************************************
  9594. *****               END Exploration Mode Upgrade                         *****
  9595. ******************************************************************************
  9596.  
  9597. Before I implemented the ExplorationMode upgrade, I had worked out the full
  9598. details of the "Play By Email" upgrade and it was going to be easy for me
  9599. to implement it.  But the ExplorationMode makes "Play By Email"
  9600. implementation far more complicated.... i.e. I no longer know how to do it.
  9601.  
  9602. * CANCELLED: The Play by Email upgrade has been CANCELLED until someone
  9603.   registers the game who has a netconnected Amiga.
  9604.  
  9605. * New routine DepthWriteText to replace FancyWriteText which only has the
  9606.   outline thing down and to the right 1-4 pixels.  Much faster + looks
  9607.   better.  DONE.
  9608.  
  9609. October 3, 1999:  My mom poisoned me with insecticides and hair spray so
  9610. I'm extremely ill.  So I can't work :( Symptoms of my illness include, my
  9611. entire body aches, I have no strength to stand up, any input of food or
  9612. water causes a violent output reaction.  Fever 101.5.  I can't lay down or
  9613. I throw up.  I can't move or I throw up from extreme nausea, its like
  9614. having super severe motion sickness.  I must sit perfectly still.  Diarhea,
  9615. stomach ache, etc.
  9616.  
  9617.  
  9618.  So I will just playtest another level.
  9619.  
  9620. Playtest SAI LEVEL 7.
  9621. Level 7: The game says I won on turn 14 even though my wizard was about 2
  9622. turns away from the exit.  I would have won 1 turn sooner I think but there
  9623. is a bug in the game where if you move a creature next to an undead and get
  9624. engaged and try to attack it then the game gets stuck and you can't cancel
  9625. the creature's move without clicking the "end turn" gadget.  Sometimes "end
  9626. turn" cancels just that 1 creature's move.  But this time it ended my turn
  9627. and I didn't get to move my other creatures!!!
  9628.  
  9629. I have now tried to duplicate this bug by playing various test games and
  9630. the bug is not reoccurring.  My unicorn was adjacent to some inanimate
  9631. objects when the bug happened and maybe this is somehow affecting things.
  9632. This is an example of a time when I should have saved the game every turn
  9633. so I could replay that turn and see what is happening.
  9634.  
  9635. Ok I reloaded the level and replayed it and uhmm... the bug is gone.  I
  9636. can't make it happen again.  It must be some very technical thing that
  9637. happens. 8(  UNSOLVED MYSTERY.
  9638.  
  9639. * BUG: When loading a game, probabilities are all messed up on the info screen!
  9640.   Just save every translated spell id, then every probabilty.
  9641.   ID,prob
  9642.   ID,prob
  9643.   etc...
  9644.   Ok I made the changes but it still doesn't work!
  9645.   Ok I tried a different method and it still doesn't work!
  9646.   4th attempt: Ok I got it working now.  It was a problem with the
  9647.   translation.  I will really be glad when the game is a proper database so
  9648.   we can get rid of all this lame translation crap!
  9649.   Total time wasted 2.5 hours.  NOW FIXED.
  9650.  
  9651. * UPGRADED All SAI's Levels to the new format successfully.
  9652.  
  9653. * YUCK! Some color combos in the credits intro are terrible.  I have
  9654.   made a better color combo for the bright red text.  DONE.
  9655.  
  9656. * FLAW: When a Bolter Wall is the last computer controlled thing to move it
  9657.   stays highlighted well into the next phase of the game.  Way longer than it
  9658.   is supposed to.  NOW FIXED.
  9659.  
  9660. * I tried to duplicate the "Kill your own wizard and get an enforcer hit"
  9661.   bug but every time I kill my own wizard there is no enforcer hit. ???
  9662.  
  9663. * DOUBLED the speed of ClearBoard();
  9664.  
  9665. * PROBLEM: It takes me forever to find the spell I want when I'm designing
  9666.   levels and testing things.  SOLUTION: Alphabetized the list of objects in
  9667.   the alt-o object chooser menu.  DONE. SOLVED.
  9668.  
  9669. There should be a menu option like "Pick Object" or something so we don't
  9670. have to press "alt-o" all the time.  Leaving this for SAI.
  9671.  
  9672. * DARK WOOD INCONGRUENCY: The description says they are undead but their
  9673.   undead_stat is not set.  NOW FIXED.
  9674.  
  9675. * AAUUGH! I cast animate on an independent generator and nothing happened!
  9676.   I have now changed the spell description to say "This spell has no effect
  9677.   on generators."  FIXED.
  9678.  
  9679.  
  9680. ****************************************************************************
  9681. *******              My First Level Playtest Notes                   *******
  9682. ****************************************************************************
  9683. 1st attempt:  I was dead on turn 9.  All 6 generators generated on turn 1. 
  9684. I had no chance.
  9685. Independents had score 87, life 358.  I had life 0, score 9.
  9686.  
  9687. Jerry's First Attempt: He died on Turn 10.
  9688. Independents had score 93, life 295.  He had life 0, score 8.
  9689.  
  9690. Attempt 2: I died on turn 11.  Independent life 261, score 78.
  9691. My life 0, score 45.
  9692.  
  9693. Attempt 3: DAMMIT I WAS GOING TO WIN AND THIS STUPID MudMan thing with 0
  9694. maneuverability just moved next to my wizard and killed him even though he
  9695. should have been engaged to my zombie!!!!!  Engagement routine needs to be
  9696. investigated!
  9697.  
  9698. Reloaded the savegame from a few turns back but this time the generators
  9699. were meaner to me and I died on turn 18.
  9700.  
  9701. * ENGAGEMENT ROUTINE FIXED: The routine now works like this:
  9702.   If you are next to 1 enemy creature THEN
  9703.      If you have  0 maneuverability you are ENGAGED.
  9704.      If you have 15 maneuverability you are NOT ENGAGED.
  9705.      If you have  1 maneuverability you have 1 chance  in 15 of not being engaged.
  9706.      If you have  2 maneuverability you have 2 chances in 15 of not being engaged.
  9707.   The engagement system is now totally logical and easy to understand.
  9708.  
  9709.  
  9710. Attempt 4: Won on turn 41.  My life: 147  Score 1161
  9711. Independent life 0 score 64.  I was only able to win because I killed a
  9712. generator and then got a Dragon Nest as my bonus spell.  But I suppose that
  9713. just makes up for my lousy luck during the rest of the game.  If you can
  9714. survive till turn 30-something you start getting really good spells that
  9715. allow you to become an effective offensive fighting force.
  9716.  
  9717.  
  9718.  ** Found the Secret Scroll **
  9719. Attempt 5: Won the game on turn 11.
  9720.  
  9721.  
  9722.  
  9723. Level 2: I won on turn 25.  Wasn't really very hard.
  9724.  
  9725. Level 3: I died on turn 5!  A Basalt Golem charged up at me from unexplored
  9726. space and whacked my already weakened wizard and killed him!  I had NO idea
  9727. he was out there!
  9728.  
  9729. Level 3: Attempt 2: I died on turn 16!
  9730.  
  9731. ****************************************************************************
  9732. *******             END My First Level Playtest Notes                *******
  9733. ****************************************************************************
  9734.  
  9735.  
  9736. * PROBLEM: You can't install Chaos to your HD by simply dragging the drawer
  9737.   icon to the HD because the req.library must also be copied to the LIBS:
  9738.   I have now changed it so that it will open the library from LIBS: or from
  9739.   the libs/ dir in the chaos dir so now the game is SUPER EASY TO INSTALL!!!
  9740.   NOW FIXED.
  9741.  
  9742.  
  9743.  
  9744. Ok I am now going to implement 2 new spells.  One will make an inanimate
  9745. object become a creature and the other will make a creature become an
  9746. inanimate object.  So what do I call these 2 spells?
  9747.  
  9748. Inanimorphobiosis or "Stone to Flesh" or "Animate"?
  9749. The trouble with calling it "Stone to Flesh" is that it doesn't turn
  9750. "stone" to "flesh" it turns any inanimate object (such as trees) into a
  9751. creature.  However this would make the spellname be the converse of the
  9752. "Flesh to Stone" spell.
  9753.  
  9754. The trouble with calling it "Animate" is that it doesn't animate the
  9755. graphic of the recipient.  It will still be a static image.  OOPS there is
  9756. already an "Animate" spell.
  9757.  
  9758. Petrify or "Flesh to Stone" or Deanimate?
  9759.  
  9760. OK, for now I will have Stone to Flesh, Inanimorphobiosis and Flesh to
  9761. Stone.  Inanimorphobiosis will be a stronger/rarer version of Stone to Flesh.
  9762. Mass Petrification will be a stronger/rarer version of Flesh to Stone.
  9763.  
  9764. * 4 NEW SPELLS: Stone to Flesh, Inanimorphobiosis, Flesh to Stone, Mass
  9765.   Petrification.
  9766.  
  9767. Stone to Flesh and Inanimorphobiosis are extremely powerful.  I need to either:
  9768. A) Reduce its probability.
  9769. B) Make it a bonus spell.
  9770. C) Make it have a CAST_NOGENERATORS
  9771. D) Make it so that it doesn't change owners.
  9772.  
  9773. I'm going with option D for Stone to flesh and option B for
  9774. Inanimorphobiosis.
  9775.  
  9776.  
  9777. * I went back and modified most of my spells to use implode cell effect for
  9778.   when something bad is happening to the recipient and implode+explode cell
  9779.   effect for when something good is happening to the recipient.  DONE.
  9780.  
  9781. * SOUND EFFECTS fully reinstated in ExplorationMode.  I have decided that I
  9782.   like to hear all the sound effects of events that happen in unexplored
  9783.   areas so I modified CellEffect() to only mask the gfx in unexplored areas
  9784.   NOT the sound effects.  DONE.
  9785.  
  9786. * BUG: Intro credits monster list sometimes has messed up colors.
  9787.   This was a problem where I had MSGRandom()%4 instead of the proper
  9788.   (MSGRandom()%3)+1  NOW FIXED.
  9789.  
  9790. * SPEEDED up the intro credits a bit.
  9791.  
  9792. * SMALL BUG IN JCformat:  Whenever a program line uses a \" after a " there
  9793.   is sometimes a messup in the alignment and/or a bogus error gets reported.
  9794.   No data is lost but it just isn't aligned right.  This could be seen in
  9795.   sm.c which has a lot of \" constructs.  I had to add an additional test to
  9796.   2 routines.  This is all NOW FIXED.
  9797.  
  9798. * ELIMINATED 2 hardcoded references to Wizard8ID and replaced them with
  9799.   IsCreature() test.
  9800.  
  9801. * VODKA changed to allow you to cast it on the independents.  Now the spell
  9802.   is actually useful for something :)
  9803.  
  9804. * CAST_ARTIFACT added to spell information screen.
  9805.  
  9806. * BUG: Enemy Computer wizard cast Stone to Flesh on my wall for me.  I have
  9807.   now added FLAG_OWN to the spellflags so that computer wizards will only cast
  9808.   this spell on their own creatures.  NOW FIXED.
  9809.  
  9810. * CHANGED SWAP: to not swap inanimate objects.
  9811.  
  9812. * BEGIN v2.80
  9813. *****************************************************************************
  9814. *****           ATTACHED SCREENS UPGRADE (OS 3.0 Required)              *****
  9815. *****************************************************************************
  9816.  
  9817. COMPLAINTS:
  9818. We have received complaints from AES and others about the game using 2
  9819. seperate screens because they typically run lots of programs and flip
  9820. between them a lot so sometimes the screens get out-of-order.
  9821.  
  9822. I have now (finally) dug up the information on attached
  9823. (parent/child/family) screens and OS 3.0 is REALLY AWESOME!!
  9824. OS 3.0 screen handling is vastly superior to OS 2.04!
  9825.  
  9826. SOLUTION: Set up the main lores screen as the parent screen and attach
  9827. the hires screen to it as a child screen.  This method will be used on OS
  9828. 3.0 systems and the original code will be used on OS 2.04 and lower
  9829. systems so the game will still run on all versions of the OS.
  9830.  
  9831. I've been wanting to have LOTS of screens open at once even though I'd only
  9832. be using 2 of them at a time.  But I haven't ever implemented that because
  9833. under OS 2.04 that would just be TOOO annoying to have to press amiga-m/n 5
  9834. times to switch out of Chaos.
  9835.  
  9836. The use of attached screens also allows me to have as many screens open as
  9837. I want without annoying anyone.  All unused screens will be hidden.  This
  9838. is going to be really kewl.
  9839.  
  9840. * IF (OS >= 3.0) THEN OpenAttachedScreens ELSE OpenUnattachedScreens. DONE.
  9841.  
  9842. * Modify MoveScreen() to transparently handle the old and new systems. DONE.
  9843.  
  9844. Ok I just tried it out and this is really AWESOME!  The screens now appear
  9845. as one.  If you drag one screen you drag them both so they can't get out of
  9846. place!  And you can't depth-arrange them wrongly either!  This is exactly
  9847. how I always wanted it to be!  This is a great reason to upgrade to OS 3.0+!
  9848.  
  9849. *****************************************************************************
  9850. *****          END ATTACHED SCREENS UPGRADE (OS 3.0 Required)           *****
  9851. *****************************************************************************
  9852.  
  9853.  
  9854. *****************************************************************************
  9855. *****             WHY CHAOS DOESN'T WORK ON A GRAPHICS CARD             *****
  9856. *****************************************************************************
  9857.  
  9858. The cell highlighting when you press a numeric key uses direct memory
  9859. writes.  Cyberygraphics and Picasso96 do not support this.
  9860.  
  9861. The animated sprite used to highlight the currently active creature uses OS
  9862. routines with no direct manipulation.  Does this work on your gfx card?
  9863. Gfx cards are lame and have 0 or 1 sprites.  The fancy gfx cards which have
  9864. 1 sprite are already using the sprite for the mousepointer so it can't be
  9865. used to highlight a creature.
  9866.  
  9867. The wavy screen effect used for various spells, (most notably vodka), uses
  9868. the copper.  Gfx cards are lame and don't have a copper so this just isn't
  9869. going to work on a gfx card.
  9870.  
  9871. The game uses 2 screens (each in a different resolution and color depth)
  9872. onscreen at once.  I do not think that cybergraphx supports this.  Does
  9873. Picasso 96?
  9874.  
  9875. The game uses color cycling.  Most gfx cards are lame and don't support
  9876. color cycling.
  9877.  
  9878. I would love to make a gfx card compatible version of Chaos which would run
  9879. in 24 bit color with superawesome graphics in 640x480 or higher resolution
  9880. but since I don't _own_ a gfx card and neither does my programming partner
  9881. SAI, it just isn't going to happen until someone buys me a graphics card.
  9882.  
  9883. *****************************************************************************
  9884. *****           END WHY CHAOS DOESN'T WORK ON A GRAPHICS CARD           *****
  9885. *****************************************************************************
  9886.  
  9887. * AGA DETECTION code added.  Now we can display different graphics
  9888.   depending on if the game is running on AGA or ECS.
  9889.   Just use IF (AGA) THEN display aga gfx
  9890.   or       IF (ECS) THEN display ecs gfx
  9891.  
  9892. * SCREWEY QUIT BUG:  Ok, regarding the quit bug that sometimes causes
  9893.   enforcer hits when we quit the game.  I have tracked it down to the
  9894.   following line of code very near the end:
  9895.   IF (HiResWindow) CloseWindow(HiResWindow);
  9896.  
  9897.   I tried adding a HandleIDCMP(DUMP_QUEUE) before that line but it made no
  9898.   difference.
  9899.  
  9900.   Now I have copied the CloseWindowSafely() function from the OS 3.0
  9901.   Includes and Autodocs so the problem is allegedly now fixed.
  9902.   Nope, I played a test game and I still get the exact same enforcer hits.
  9903.  
  9904. * 64 bit alignment of screen memory implemented.  This allows the entire
  9905.   computer to run faster when playing the game on AGA Amigas because the
  9906.   display will be running at 4x bandwidth.
  9907.  
  9908. * DEFAULTS CHANGED to start with 1 human vs 1 computer wizard + 4 generators.
  9909.  
  9910. * SCREWEY QUIT BUG FINALLY SOLVED!!!!
  9911.   Ok, the bug was caused by the fact that when the
  9912.   CloseWindow(HiResWindow); was executed, at that moment the
  9913.   HiResRastPort->Layer was == 0;
  9914.  
  9915.   This could only happen when you played a game then quit it or won and
  9916.   went back to the main screen then quit the game; which explains why it
  9917.   never seemed to happen unless you played a "real game".
  9918.  
  9919.   I had examined this possibility before but there were ONLY 2 lines of
  9920.   code that changed the value of HiResRastPort->Layer.
  9921.   1 line disabled the layers and 1 line reenabled them so I thought it was
  9922.   working 100%.  Unfortunately due to the spaghetti code nature these 2
  9923.   lines were not being executed in pairs.
  9924.  
  9925.   BTW: sometimes this bug would not cause enforcer hits but would instead
  9926.   randomly trash a few memory locations.  This happened to me dozens of times
  9927.   when qutting the game would trash a few bytes of my source code in Cygnus
  9928.   Ed Professional!!
  9929.  
  9930.   This bug took me 20 hours to fix. :(
  9931.  
  9932.   ALL FIXED NOW!
  9933.  
  9934.  
  9935. * BUG: Vodka has no effect on Independents.  NOW FIXED.
  9936.  
  9937. * BUG: Agents cast harmful spells against their friends and allies.
  9938.   Allegedly NOW FIXED.
  9939.  
  9940. * BUG: COMPUTER WIZARDS ALWAYS CAST PLASMABEAM STUPIDLY:
  9941.   NOW FIXED.
  9942.  
  9943. * I also modified the PlasmaBeamHandler and stupidity checking to be
  9944.   compatible with AgentCasting.  DONE.
  9945.  
  9946. * WROTE a new PlasmaBeamRanking() routine so the computer wizards will try
  9947.   to cast it under the most favorable circumstances.
  9948.  
  9949. * FLAW: PlasmaBeamHandler always converts illegal coordinates into a cell
  9950.   with GetCell().  NOW FIXED.
  9951.  
  9952. * NEW ROUTINES for Plasma Beam AI:
  9953.   PlasmaBeamStupidity() to check for a stupid PlasmaBeam cast.
  9954.   PlasmaBeamRanking() to calculate the score for IntelligentComputerSpellSelect()
  9955.   PlasmaBeamDecideWhichDirection() to calculate the best cell to cast
  9956.                                    Plasma Beam on.
  9957.   PlasmaBeamEvaluate() Low level code used by the Ranking and
  9958.                        DecideWhichDirection routines.
  9959.  
  9960. * uhmmm there were major problems in the spellcasting AI...
  9961.   IsStupidCast() was assuming that the spell was being cast from the
  9962.   WIZARD's cell thus it couldn't possibly have worked with AgentCasting.
  9963.   Maybe this explains why agents cast sleep on friendly creatures?  NOW FIXED.
  9964.  
  9965.   PROBLEM: The entire rest of the spellcasting system is always ASSUMING
  9966.   that spells are cast from the cell of the Wizard rather than from wherever
  9967.   they are being cast from.  I don't see how any spells could work properly
  9968.   with AgentCasting except for CAST_FREE spells.  No spell routines take a
  9969.   CasterCell parameter.  They all take a player parameter and just assume the
  9970.   caster is at the wizard's location.  I never play with AgentCasting so
  9971.   I'll just leave this for SAI to fix.
  9972.  
  9973. * MAJOR BUGs in IntelligentComputerSpellSelect() and other routines.
  9974.   The following macros were all defective and returned wrong results when
  9975.   used with magic spells instead of "objects".
  9976.   IsIDundead, IsIDstatic, IsIDmount, IsIDdragon, IsIDgrowth, IsIDinanimate,
  9977.   IsIDmeditation, IsIDarcher, IsIDflying, IsIDshooter, IsIDspecialcombat,
  9978.   IsIDweirdattacker.
  9979.   This was caused by the game not being a real database.
  9980.   The computer ranking of spells  was all messed up because of these bugs.
  9981.   NOW FIXED.
  9982.  
  9983. * MAJOR BUG in IsStupidCast() All CAST_FREE spells were being handled all
  9984.   wrong.  This was totally messing up the computer's thinking.  CAST_FREE
  9985.   spells were routinely being regarded as REALLY_STUPID(-3) when in fact they
  9986.   were the best and most usefull spell possible.  NOW FIXED.
  9987.  
  9988. * Test Plasma Beam.  Give a computer wizard some Plasma Beams and some bless
  9989.   spells and see what he does in various situations.  DONE.
  9990.  
  9991. * ADDED stupidity checking for Alternography.
  9992.  
  9993. * AdjacentCell(cell,number) new predicate which allows us to write loops
  9994.   for handling all cells adjacent to a particular cell 8x smaller.  DONE.
  9995.  
  9996. Developer debug filesize is currently 2002684 bytes
  9997.  
  9998. * REWROTE the following routines using AdjacentCell(cell,number)
  9999.   and saved the following amounts from the 68000 release executable:
  10000.   SpecialCombatHandler()                  saved 1560 bytes
  10001.   All 7 adjacency routines in predicate.c saved 5428 bytes
  10002.   PossibleChoice/ChooseAdjacent           saved  360 bytes
  10003.   GoblinBomb() stuff                      saved  588 bytes 
  10004.                                     TOTAL SAVED 7936 bytes
  10005.  
  10006.   We are  saving an additional 2k for each AI routine, such as
  10007.   PlasmaBeamEvaluate(), that uses the new AdjacentCell() technique.
  10008.  
  10009. * DEVELOPER version now generates 020+ code.
  10010.  
  10011. * ABOVE 2 changes reduced the developer debug filesize to 1983388
  10012.   SAVED 19296 bytes!
  10013.  
  10014. * INCLUDED spellmanager into the archive.
  10015.  
  10016. * ExplorationMode option now on setup screen II.
  10017.  
  10018.  
  10019. **********  MAJOR BUG IN TerminateChaos() *******************************
  10020.  
  10021. BUG: Patrick Hawkins reports: If the talklists file is not present then an
  10022. alert is generated telling you it isn't there.  Then the whole computer
  10023. crashes.
  10024.  
  10025. BUG: Kermit reports: If you don't have narrator.device then an alert is
  10026. generated saying "Could not open narrator.device" then the whole computer
  10027. crashes.
  10028.  
  10029. BUG: James Conwell reports: If ANYTHING goes wrong in CommenceChaos(), a
  10030. file is not found, a library can't be opened, a device is missing, etc.
  10031. then a nice alert is generated telling you such.  Then the entire computer
  10032. ALWAYS crashes.
  10033.  
  10034. ALL FIXED NOW.
  10035.  
  10036. ****************************************************************************
  10037.  
  10038. ****************************************************************************
  10039.                            MEMORY LEAKS
  10040. ****************************************************************************
  10041.  
  10042. BUG:
  10043. 1. Delete the file Devs:narrator.device
  10044. 2. avail flush
  10045. 3. run chaos
  10046. 4. avail flush
  10047. 5. You will now see that you are missing 40 bytes of fastram. :(
  10048.  
  10049. BUG:
  10050. 1. Put the narrator.device file back into devs:
  10051. 2. avail flush
  10052. 3. run chaos
  10053. 4. quit the game on the main setup screen
  10054. 5. avail flush
  10055. 6. You will now see that you are missing 192 bytes of fastram. :(
  10056.  
  10057. BUG:
  10058. 1. Run the game.
  10059. 2. Quit the game.
  10060. 3. You will now see that you are missing 240 bytes of fastram. :(
  10061.  
  10062. ALL THESE leaks are fixed months later in March, 2000 by JC.
  10063. *****************************************************************************
  10064.                          END MEMORY LEAKS
  10065. *****************************************************************************
  10066.  
  10067.  
  10068. **************************************************************************
  10069. *****                    SEMAPHORE BUGS!                             *****
  10070. **************************************************************************
  10071.  
  10072. Anything that changes cellp->id or the Exploration status of
  10073. a cell or the global PlayerView MUST be done while holding
  10074. the semaphore!  Else bad things can (and eventually will) happen!
  10075.  
  10076. Also, anything that changes or READS the value of cellp->flag MUST be done
  10077. with a lock on the board semaphore!
  10078.  
  10079. Otherwise, occassionaly, the variables will exist in a state of
  10080. incongruency.  This could trigger extremely rare, totally unreproducable,
  10081. horrible bugs.  This one concept might explain ALL of the bizarre
  10082. unreproducable bugs that we've ever had in the past.
  10083.  
  10084. * FIXED in core.c: ChangePlayerView(); ClearVisible(); PutToSleep(); WakeUp();
  10085.   RestoreCell(); BackUp(); BackUpWizard(); RestoreCellWizard();
  10086.   ExploreCell(); CompletelyRecalculateTeamExplore();
  10087.   EVERYTHING IN core.c ALLEGEDLY NOW FIXED.
  10088.  
  10089. * FIXED in chaos.c: CalculateArtifactOwners();
  10090. * FIXED in init.c:  InitialisePlayers();
  10091. * FIXED in io.c:    SaveGame(), LoadGame();
  10092. * FIXED in move.c:  Combat();
  10093. * FIXED spells:     No spells needed changing.
  10094.  
  10095. Ok, that takes care of all the occurrences of .flag and ->flag and .id and
  10096. ->id.  Now I must search for all forms of code such as:
  10097. board[cell]=board[c]
  10098. board[newcell] = board[oldcell]
  10099. etc. etc. ad infintum.
  10100.  
  10101. * FIXED spells: hyperclone, replicate, alliance, separation
  10102. * FIXED init.c: initialise_players()
  10103. * FIXED io.c:   LoadGame()
  10104. * FIXED warp.c: WarpOut()
  10105.  
  10106. Ok, AFAIK all code which needs a semaphore lock now has it.
  10107.  
  10108. The game SHOULD be 100% rock solid now.
  10109. **************************************************************************
  10110. *****                   END SEMAPHORE BUGS!                          *****
  10111. **************************************************************************
  10112.  
  10113. * PROBLEM: Casting Stone to Flesh or Inanimorphobiosis on a wall gives you
  10114.   a wall which can be moved but it can't actually attack anything.  I changed
  10115.   it so that it will always be able to attack the living and if the inanimate
  10116.   object was undead then it will also be able to attack undeads. NOW FIXED.
  10117.  
  10118. Since I have now implemented AI for Plasma Beam, this allows me to
  10119. implement similar AI for a whole range of new beam spells.
  10120.  
  10121. * 11 NEW SPELLS: Brain Drain Beam, Demonic Touch Beam, Combat Drain Beam,
  10122.   Range Drain Beam, Recover Drain Beam, Lethargy Beam, Paralyzation Beam,
  10123.   Life Drain Beam, Toxicity Beam, Encumberance Beam, Sluggishness Beam.
  10124.   These spells do not affect corpses or scrolls.  Each spell has its own AI
  10125.   routine.
  10126.  
  10127. * MODIFIED the above spells + PlasmaBeam to do the WHITECIRCLEIM instead of the
  10128.   WHITECIRCLEEX effect in order to keep in tune with my "WHITECIRCLEIM=BAD,
  10129.   WHITECIRCLEEX=GOOD" concept. Also made them do the cool EXPLODE effect if
  10130.   it kills a target.  Also put in a delay when a creature is killed by a
  10131.   beam so that your eye can clearly follow the action and see which creature
  10132.   was killed.
  10133.  
  10134.  
  10135. I cast Toxicity Beam on an enemy wizard so that all his recovery stats are
  10136. -1 yet his Combat and Maneuverability are NOT going down to 0 like they are
  10137. supposed to.
  10138.  
  10139. * BUG! Combat, Maneuverability, Ranged Combat and Special Combat
  10140.   recovery/poisoning don't work right!!!   NOW FIXED.
  10141.  
  10142. * The holder of the Sword of Sassenrath makes his nearby friends more
  10143.   intelligent.  DONE.
  10144.  
  10145.  
  10146. * PROBLEM: cutting and pasting a wizard in the level editor doesn't
  10147.   "unexplore" the cells that he has already mapped out.
  10148.   How do we fix this???
  10149.  
  10150.   We need an option in the editor to RESET EXPLORATION BITS
  10151.   this will 0 out all exploration bits and then call ExploreCell(cell) on
  10152.   EVERY cell.  The board will then be properly mapped out.  NOW FIXED.
  10153.  
  10154.   You should use the menu option "ResetExplorationBits" right before you
  10155.   save the final version of your level.  If you don't use this menu option
  10156.   then there may be various creatures who are standing in unexplored space.
  10157.   Use this menu option as often as you like.  It doesn't hurt anything.
  10158.  
  10159.   A side effect of this is that SAI's most recent level is now much harder
  10160.   because there are Independent walls everywhere.  Previously these walls
  10161.   existed in unexplored space and so did most of the board, so the Emerald
  10162.   Dragon Brigade couldn't see you to shoot at you.
  10163.  
  10164.   Using this new menu option means that all the Independent walls all over
  10165.   the board will explore the space around them, meaning they can see pretty
  10166.   much the entire world.  This means the Independent archers can shoot at you
  10167.   long before you can see them.  Ditto for Independent dragons, etc.
  10168.  
  10169.   I assume this is ok with you.  If not then let me know and we can work
  10170.   something out.
  10171.  
  10172.   For example if you want to make a level where the independents can't see
  10173.   everything then you can just make all your passageways be composed of walls
  10174.   belonging to a nonexistent player or even to NOBODY.
  10175.   
  10176. ****************************************************************************
  10177.                       Codex Sirconia Upgrade
  10178. ****************************************************************************
  10179.  
  10180. * Several small corrections made.
  10181.  
  10182. * Problem: There is no explanation of Summoning, only of Subjugation.
  10183.   7 new paragraphs added.  NOW FIXED.
  10184.  
  10185. * Problem: There is no explanation of how the world can exist in a
  10186.   2-dimensional state and yet flying creatures can "fly" "over" other
  10187.   objects.  2 paragraphs added. NOW FIXED.
  10188.  
  10189. Still need to come up with some sort of explanation for undeads and why
  10190. they can't be attacked.  ???
  10191.  
  10192. * Added 1 more paragraph.
  10193.  
  10194. * NEW SECTION: "The Folly of Man" to explain generators.  10 paragraphs.
  10195.  
  10196. ****************************************************************************
  10197.                     END Codex Sirconia Upgrade
  10198. ****************************************************************************
  10199.  
  10200.  
  10201. ****************************************************************************
  10202.                        PassRMB(window) BUG
  10203. ****************************************************************************
  10204.  
  10205. * BUG: I was player 1 and I clicked my archer immediately then immediately
  10206.   clicked the RMB while it was still saying "wood elf" and things got messed
  10207.   up.  I couldn't move or cancel his move.  I had to hit the end turn gadget
  10208.   to be able to shoot and continue.
  10209.   OK, I put in some code to PassRMB; GetSpellSelection(); TrapRMB; so now the
  10210.   entire game should be running with TrapRMB except for the spell-selection
  10211.   phase.  ALLEGEDLY NOW FIXED.
  10212.  
  10213.   However there is probably still a weird bug because for some reason
  10214.   the HandleIDCMP() does a PassRMB depending on what type of cell return is
  10215.   requested.  I don't think that is right.
  10216.  
  10217.   Ok I just played a test game and I was able to click on my wood elf and
  10218.   bring up the menus every single time!  I was able to do the "about" menu
  10219.   and "new game" menu and "scores" from within the movement phase!!!!
  10220.   And each time I did it, it messed up the movement of my wood elf.
  10221.   Something somewhere is doing a PassRMB that isn't supposed to.
  10222.  
  10223.   Ok I have now removed all occurences of PassRMB() from HandleIDCMP()
  10224.   and the bug is REALLY NOW FIXED.
  10225.  
  10226.   If those commented out PassRMB()s mess something up then let me know.
  10227.   (I don't forsee any problems)
  10228.  
  10229. ****************************************************************************
  10230.                      END PassRMB(window) BUG
  10231. ****************************************************************************
  10232.  
  10233. * Installed Deluxe Paint 5.  + Cracked Gold font + Earth Yellow font
  10234.   (looks good in a comical/cartoony sort of way)
  10235.  
  10236. * Put in all of SAI's new spell graphics into the game.
  10237.  
  10238. November 25th, 1999:
  10239.   INSTALLED Chaos 2.70 on JJ's Amiga 3000.
  10240.   SENT Chaos 2.70 to SAI for use in level-designing etc.
  10241.  
  10242.  
  10243.  
  10244. December 4th, 1999:
  10245. * ENFORCER HITS if either of the screens or windows fails to open then
  10246.   enforcer hits are generated by TerminateChaos(); NOW FIXED.
  10247.  
  10248. December 6th, 1999:
  10249. * MAJOR RMB BUG FOUND.  You can access the menus from within the movement
  10250.   phase with disastrous results.  Furthermore you can't cancel your
  10251.   spellcasts with the RMB thus the game locks up when you cast a spell but
  10252.   have no legal targets. I found this while playtesting my 3rd level, I had
  10253.   just got a Summons spell as a bonus spell for killing a ShapeChanger, so I
  10254.   was going to _finally_ be able to win.  I had 7 open squares adjacent to my
  10255.   wizard so I cast it immediately.  I cast 7 good creatures and then I
  10256.   couldn't cancel the 8th one!  So the game was STUCK!  ARRRGH!  NOW FIXED.
  10257.  
  10258. December 10th, 1999: JJ is complaining about his ally's growths growing
  10259. over his creatures.  And he isn't allowed to attack the growth and kill it
  10260. since its his ally.  SAI never stated an opinion on this matter so I am
  10261. hereby making a
  10262.  
  10263. * NEW RULE: The growths of your allies do not grow over your creatures.
  10264.   Except for Fire and Flood which still attack EVERYONE as usual.
  10265.   NOW FIXED.
  10266.  
  10267. * Recompiled and redelivered v2.71 for JJ.
  10268.  
  10269. * Chaos v2.71 FINALIZED.  This is the final OS 1.2 / 1.3 / 2.04 compatible
  10270.   version of Chaos.  All future versions require OS 3.0 or higher.
  10271.